Skip to content

Commit 9242f22

Browse files
authored
Rollup merge of #42638 - arthurpaimarnold:lexer_rule_for_octal, r=petrochenkov
Possible mistake in lexer rule for octal integer Original rule allowed for digits 0-8, but octal is 0-7. The compiler correctly prevents you from placing an 8 in an octal, so I'm assuming this is caught on a later stage. Still, shouldn't the lexer already catch this?
2 parents d60b291 + c291e87 commit 9242f22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/grammar/lexer.l

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ while { return WHILE; }
126126
{ident} { return IDENT; }
127127

128128
0x[0-9a-fA-F_]+ { BEGIN(suffix); return LIT_INTEGER; }
129-
0o[0-8_]+ { BEGIN(suffix); return LIT_INTEGER; }
129+
0o[0-7_]+ { BEGIN(suffix); return LIT_INTEGER; }
130130
0b[01_]+ { BEGIN(suffix); return LIT_INTEGER; }
131131
[0-9][0-9_]* { BEGIN(suffix); return LIT_INTEGER; }
132132
[0-9][0-9_]*\.(\.|[a-zA-Z]) { yyless(yyleng - 2); BEGIN(suffix); return LIT_INTEGER; }

0 commit comments

Comments
 (0)