tokenize: detect "..." after a number literal

This commit is contained in:
Andrew Kelley 2016-01-07 04:00:05 -07:00
parent a3c97081ca
commit ea69d6ecda

View File

@ -816,6 +816,15 @@ void tokenize(Buf *buf, Tokenization *out) {
case TokenizeStateNumber:
{
if (c == '.') {
if (t.pos + 1 < buf_len(t.buf)) {
uint8_t next_c = buf_ptr(t.buf)[t.pos + 1];
if (next_c == '.') {
t.pos -= 1;
end_token(&t);
t.state = TokenizeStateStart;
continue;
}
}
t.cur_tok->decimal_point_pos = t.pos;
t.state = TokenizeStateFloatFraction;
break;