mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Allow not_in as keyword over notin, but still allow notin to work
This commit is contained in:
@@ -124,7 +124,7 @@ Token_Kind :: enum u32 {
|
||||
For,
|
||||
Switch,
|
||||
In,
|
||||
Notin,
|
||||
Not_In,
|
||||
Do,
|
||||
Case,
|
||||
Break,
|
||||
@@ -259,7 +259,7 @@ tokens := [Token_Kind.COUNT]string {
|
||||
"for",
|
||||
"switch",
|
||||
"in",
|
||||
"notin",
|
||||
"not_in",
|
||||
"do",
|
||||
"case",
|
||||
"break",
|
||||
@@ -316,7 +316,7 @@ is_operator :: proc(kind: Token_Kind) -> bool {
|
||||
#partial switch kind {
|
||||
case .B_Operator_Begin .. .B_Operator_End:
|
||||
return true;
|
||||
case .In, .Notin:
|
||||
case .In, .Not_In:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user