From 0434281f734db10ff17b68395e593d4a07b03d8d Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 6 Sep 2021 20:15:59 +0100 Subject: Strip semicolons; Make `odin strip-semicolon` replace `..` with `..=` if used as a binary operator --- src/parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index 4433a0a7f..778afbcd6 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1376,6 +1376,10 @@ Token expect_operator(AstFile *f) { syntax_error(f->curr_token, "Expected an non-range operator, got '%.*s'", LIT(p)); } + if (f->curr_token.kind == Token_Ellipsis) { + f->tokens[f->curr_token_index].flags |= TokenFlag_Replace; + } + advance_token(f); return prev; } -- cgit v1.2.3