Add more operators to lexer
This commit is contained in:
@@ -350,24 +350,31 @@ binding_power(Binding binding, Token_Kind kind){
|
|||||||
default: return {-1, -1};
|
default: return {-1, -1};
|
||||||
}
|
}
|
||||||
Infix: switch(kind){
|
Infix: switch(kind){
|
||||||
|
case TK_Or:
|
||||||
|
return {9,10};
|
||||||
|
case TK_And:
|
||||||
|
return {11,12};
|
||||||
case TK_Equals:
|
case TK_Equals:
|
||||||
case TK_NotEquals:
|
case TK_NotEquals:
|
||||||
case TK_GreaterThen:
|
case TK_GreaterThen:
|
||||||
case TK_GreaterThenOrEqual:
|
case TK_GreaterThenOrEqual:
|
||||||
case TK_LesserThen:
|
case TK_LesserThen:
|
||||||
case TK_LesserThenOrEqual:
|
case TK_LesserThenOrEqual:
|
||||||
return {3,4};
|
return {13,14};
|
||||||
case TK_Sub:
|
case TK_Sub:
|
||||||
case TK_Add:
|
case TK_Add:
|
||||||
return {5,6};
|
case TK_BitOr:
|
||||||
|
case TK_BitXor:
|
||||||
|
return {15,16};
|
||||||
case TK_RightShift:
|
case TK_RightShift:
|
||||||
case TK_LeftShift:
|
case TK_LeftShift:
|
||||||
|
case TK_BitAnd:
|
||||||
case TK_Mul:
|
case TK_Mul:
|
||||||
case TK_Div:
|
case TK_Div:
|
||||||
case TK_Mod:
|
case TK_Mod:
|
||||||
return {7,8};
|
return {17,18};
|
||||||
case TK_Dot:
|
case TK_Dot:
|
||||||
return {10,9};
|
return {20,19};
|
||||||
default: return {};
|
default: return {};
|
||||||
}
|
}
|
||||||
Postfix: switch(kind){
|
Postfix: switch(kind){
|
||||||
|
|||||||
Reference in New Issue
Block a user