Skip to content

Commit

Permalink
Rollup merge of rust-lang#42638 - arthurpaimarnold:lexer_rule_for_oct…
Browse files Browse the repository at this point in the history
…al, 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?
  • Loading branch information
frewsxcv authored Jun 13, 2017
2 parents d60b291 + c291e87 commit 9242f22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/grammar/lexer.l
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ while { return WHILE; }
{ident} { return IDENT; }

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

0 comments on commit 9242f22

Please sign in to comment.