diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-06-13 17:15:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-13 17:15:04 -0400 |
| commit | 9242f22666e44d525e57a6f4ade91be450f0ee2e (patch) | |
| tree | 03f28fa7e4ab70baca8217f633446e0811f3a32b | |
| parent | d60b291c8f83b9ce82281dc60e18861623ff8946 (diff) | |
| parent | c291e87dae377c3632c6731d618ef1433d79b041 (diff) | |
| download | rust-9242f22666e44d525e57a6f4ade91be450f0ee2e.tar.gz rust-9242f22666e44d525e57a6f4ade91be450f0ee2e.zip | |
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?
| -rw-r--r-- | src/grammar/lexer.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grammar/lexer.l b/src/grammar/lexer.l index 77737c99496..91652bfdf24 100644 --- a/src/grammar/lexer.l +++ b/src/grammar/lexer.l @@ -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; } |
