mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-17 08:40:12 -04:00
Remove switch in in favour of switch _ in
This commit is contained in:
1 parent
49ab935ae9
commit
cd74cdfdaf
6 files changed
+13
-10
No files matched your search
+4
-1
@@ -4382,7 +4382,10 @@ gb_internal Ast *parse_switch_stmt(AstFile *f) {
|
||||
f->expr_level = -1;
|
||||
defer (f->expr_level = prev_level);
|
||||
|
||||
if (allow_token(f, Token_in)) {
|
||||
if (f->curr_token.kind == Token_in) {
|
||||
Token in_token = expect_token(f, Token_in);
|
||||
syntax_error(in_token, "Prefer 'switch _ in' over 'switch in'");
|
||||
|
||||
auto lhs = array_make<Ast *>(heap_allocator(), 0, 1);
|
||||
auto rhs = array_make<Ast *>(heap_allocator(), 0, 1);
|
||||
Token blank_ident = token;
|
||||
|
||||
Reference in new issue
Block a user