Allow not_in as keyword over notin, but still allow notin to work

This commit is contained in:
gingerBill
2020-01-16 10:00:14 +00:00
parent 527b39ce2b
commit 159150c6d9
9 changed files with 31 additions and 30 deletions
+3 -6
View File
@@ -501,6 +501,9 @@ scan :: proc(t: ^Tokenizer) -> Token {
break check_keyword;
}
}
if kind == .Ident && lit == "notin" {
kind = .Not_In;
}
}
case '0' <= ch && ch <= '9':
kind, lit = scan_number(t, false);
@@ -575,12 +578,6 @@ scan :: proc(t: ^Tokenizer) -> Token {
}
case '>': kind = switch4(t, .Gt, .Gt_Eq, '>', .Shr,.Shr_Eq);
case '≠': kind = .Not_Eq;
case '≤': kind = .Lt_Eq;
case '≥': kind = .Gt_Eq;
case '∈': kind = .In;
case '∉': kind = .Notin;
case '.':
if '0' <= t.ch && t.ch <= '9' {
kind, lit = scan_number(t, true);