fix parsing of hex literal 0xb

master
Josh Wolfe 2016-04-08 17:32:06 -07:00
parent 73c814e5c0
commit d5d6c93da4
1 changed files with 3 additions and 0 deletions

View File

@ -947,12 +947,15 @@ void tokenize(Buf *buf, Tokenization *out) {
switch (c) { switch (c) {
case 'b': case 'b':
t.cur_tok->radix = 2; t.cur_tok->radix = 2;
t.state = TokenizeStateNumber;
break; break;
case 'o': case 'o':
t.cur_tok->radix = 8; t.cur_tok->radix = 8;
t.state = TokenizeStateNumber;
break; break;
case 'x': case 'x':
t.cur_tok->radix = 16; t.cur_tok->radix = 16;
t.state = TokenizeStateNumber;
break; break;
default: default:
// reinterpret as normal number // reinterpret as normal number