mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
tokenize: detect "..." after a number literal
This commit is contained in:
parent
a3c97081ca
commit
ea69d6ecda
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user