Added 'is', 'as' and 'of'
This commit is contained in:
parent
d0a252e13c
commit
e6dbc3cad6
|
@ -101,14 +101,13 @@ foreachStmt → "foreach" "(" (IDENTIFIER ":" expression) ")" statement;
|
||||||
// Expressions (rules that produce a value, but also have side effects)
|
// Expressions (rules that produce a value, but also have side effects)
|
||||||
expression → assignment;
|
expression → assignment;
|
||||||
assignment → (call ".")? IDENTIFIER "=" assignment | lambdaExpr; // Assignment is the highest-level expression
|
assignment → (call ".")? IDENTIFIER "=" assignment | lambdaExpr; // Assignment is the highest-level expression
|
||||||
asExpr → expression "as" expression;
|
|
||||||
lambdaExpr → declModifiers? "async"? "lambda" lambda; // Lambdas are anonymous functions, so they act as expressions
|
lambdaExpr → declModifiers? "async"? "lambda" lambda; // Lambdas are anonymous functions, so they act as expressions
|
||||||
yieldExpr → "yield" expression;
|
yieldExpr → "yield" expression;
|
||||||
awaitExpr → "await" expression;
|
awaitExpr → "await" expression;
|
||||||
logic_or → logic_and ("and" logic_and)*;
|
logic_or → logic_and ("and" logic_and)*;
|
||||||
logic_and → equality ("or" equality)*;
|
logic_and → equality ("or" equality)*;
|
||||||
equality → comparison (( "!=" | "==") comparison )*;
|
equality → comparison (( "!=" | "==") comparison )*;
|
||||||
comparison → term (( ">" | ">=" | "<" | "<=" ) term )*;
|
comparison → term (( ">" | ">=" | "<" | "<=" | "as" | "is" | "of") term )*;
|
||||||
term → factor (( "-" | "+" ) factor )*; // Precedence for + and - in operations
|
term → factor (( "-" | "+" ) factor )*; // Precedence for + and - in operations
|
||||||
factor → unary (("/" | "*" | "**" | "^" | "&") unary)*; // All other binary operators have the same precedence
|
factor → unary (("/" | "*" | "**" | "^" | "&") unary)*; // All other binary operators have the same precedence
|
||||||
unary → ("!" | "-" | "~") unary | call;
|
unary → ("!" | "-" | "~") unary | call;
|
||||||
|
|
Loading…
Reference in New Issue