| author | |
| committer | |
| log | c93aa7f22aec05919b0a796c11acc543ece939d7 |
| tree | e70a588d10c9511b3ad9ad80ffee3dc8bfed8cde |
| parent | bc6e21dae00fe292462a68138fc26ee7a6753bfb |
| signature | Commit is signed but in an unrecognized format. |
2 files changed, 10 insertions(+), 1 deletions(-)
CHANGELOG.md+1| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | - fix(sema): fix passing structs as function params |
| 8 | 8 | - fix: diagnostic box drawing characters line up after line 9 |
| 9 | 9 | - fix: diagnostics on last line of file print correctly |
| 10 | - fix: diagnostics with the leading zero warning | |
| 10 | 11 | |
| 11 | 12 | ## 0.1.4 |
| 12 | 13 |
src/core/Transform.zig+9-1| ... | ... | @@ -881,7 +881,15 @@ fn transformExpression( |
| 881 | 881 | else => @compileError(unreachable), |
| 882 | 882 | }; |
| 883 | 883 | |
| 884 | if (value != 0 and text[0] == '0' and (text.len == 1 or text[1] != '.')) { | |
| 884 | const has_zero_prefix = value != 0 and | |
| 885 | text[0] == '0' and | |
| 886 | (text.len == 1 or switch (tag) { | |
| 887 | .number_int => text[1] >= '0' and text[1] < '9', | |
| 888 | .number_float => text[1] != '.', | |
| 889 | else => @compileError(unreachable), | |
| 890 | }); | |
| 891 | ||
| 892 | if (has_zero_prefix) { | |
| 885 | 893 | try t.report.warn(.zero_prefixed_literal, .{ .token = t.ast.nodeToken(node) }); |
| 886 | 894 | } |
| 887 | 895 |