mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-21 05:05:00 -07:00
Allow not_in as keyword over notin, but still allow notin to work
This commit is contained in:
+2
-2
@@ -1196,7 +1196,7 @@ bool is_token_range(Token tok) {
|
||||
|
||||
Token expect_operator(AstFile *f) {
|
||||
Token prev = f->curr_token;
|
||||
if ((prev.kind == Token_in || prev.kind == Token_notin) && (f->expr_level >= 0 || f->allow_in_expr)) {
|
||||
if ((prev.kind == Token_in || prev.kind == Token_not_in) && (f->expr_level >= 0 || f->allow_in_expr)) {
|
||||
// okay
|
||||
} else if (!gb_is_between(prev.kind, Token__OperatorBegin+1, Token__OperatorEnd-1)) {
|
||||
syntax_error(f->curr_token, "Expected an operator, got '%.*s'",
|
||||
@@ -2515,7 +2515,7 @@ i32 token_precedence(AstFile *f, TokenKind t) {
|
||||
return 5;
|
||||
|
||||
case Token_in:
|
||||
case Token_notin:
|
||||
case Token_not_in:
|
||||
if (f->expr_level < 0 && !f->allow_in_expr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user