authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-08-28 15:56:24+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-09-03 15:05:47+03:00
log1174cb15173208ead5f2ce828ade5b7d07ce6abe
treeebc70cdd6f59c97d100a1302c898564afa9e1d08
parent6ab0ac161e02c2361b72d124423509556b9332fa
signaturelock-open Commit is signed but in an unrecognized format.

stage2: fix tokenizer float bug


1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/zig/tokenizer.zig+2-1
......@@ -1175,6 +1175,7 @@ pub const Tokenizer = struct {
11751175 },
11761176 .num_dot_dec => switch (c) {
11771177 '.' => {
1178 result.id = .IntegerLiteral;
11781179 self.index -= 1;
11791180 state = .start;
11801181 break;
......@@ -1183,7 +1184,6 @@ pub const Tokenizer = struct {
11831184 state = .float_exponent_unsigned;
11841185 },
11851186 '0'...'9' => {
1186 result.id = .FloatLiteral;
11871187 state = .float_fraction_dec;
11881188 },
11891189 else => {
......@@ -1769,6 +1769,7 @@ test "tokenizer - number literals decimal" {
17691769 testTokenize("7", &[_]Token.Id{.IntegerLiteral});
17701770 testTokenize("8", &[_]Token.Id{.IntegerLiteral});
17711771 testTokenize("9", &[_]Token.Id{.IntegerLiteral});
1772 testTokenize("1..", &[_]Token.Id{ .IntegerLiteral, .Ellipsis2 });
17721773 testTokenize("0a", &[_]Token.Id{ .Invalid, .Identifier });
17731774 testTokenize("9b", &[_]Token.Id{ .Invalid, .Identifier });
17741775 testTokenize("1z", &[_]Token.Id{ .Invalid, .Identifier });