aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-12-21 11:34:15 +0000
committergingerBill <bill@gingerbill.org>2018-12-21 11:34:15 +0000
commitb504d6e12ab70de583f70955c8ba6150b23ddc56 (patch)
tree0099847c4b351afff21ff63b5196ef9ea42b0bb9 /src/parser.cpp
parentb4e83a430a8401e915346cd2d6063d8a8a2d1e03 (diff)
`notin` operator
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 1942ea2ad..a9d7737ad 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1158,7 +1158,7 @@ Token expect_token_after(AstFile *f, TokenKind kind, char *msg) {
Token expect_operator(AstFile *f) {
Token prev = f->curr_token;
- if (prev.kind == Token_in && (f->expr_level >= 0 || f->allow_in_expr)) {
+ if ((prev.kind == Token_in || prev.kind == Token_notin) && (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'",
@@ -2355,6 +2355,7 @@ i32 token_precedence(AstFile *f, TokenKind t) {
case Token_GtEq:
return 5;
case Token_in:
+ case Token_notin:
if (f->expr_level >= 0 || f->allow_in_expr) {
return 6;
}