about summary refs log tree commit diff
path: root/grammar.ebnf
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-07-15 23:50:35 +0200
committerBaitinq <[email protected]>2025-07-15 23:59:21 +0200
commit4e2ce1b6c484a60b1d9f0d6bb917ba51d6258e4e (patch)
treeaa374e4bd197e5b9d0482f363e8c30cbb3fe55b1 /grammar.ebnf
parentBoostrap: Regenerate stage 0 in script (diff)
downloadpry-lang-4e2ce1b6c484a60b1d9f0d6bb917ba51d6258e4e.tar.gz
pry-lang-4e2ce1b6c484a60b1d9f0d6bb917ba51d6258e4e.tar.bz2
pry-lang-4e2ce1b6c484a60b1d9f0d6bb917ba51d6258e4e.zip
Feature: Add support for and and or operators
Diffstat (limited to 'grammar.ebnf')
-rw-r--r--grammar.ebnf8
1 files changed, 5 insertions, 3 deletions
diff --git a/grammar.ebnf b/grammar.ebnf
index 48667b2..d246838 100644
--- a/grammar.ebnf
+++ b/grammar.ebnf
@@ -18,13 +18,15 @@ ReturnStatement ::= RETURN (Expression)?
 
 FunctionArguments ::= Expression ("," Expression)*
 
-Expression ::= EqualityExpression | AdditiveExpression
+Expression ::= LogicalExpression
 
 CastStatement ::= "cast" LPAREN TYPE "," Expression RPAREN
-    
+
 SizeOfStatement ::= "sizeof" LPAREN TYPE RPAREN
 
-EqualityExpression ::= AdditiveExpression ("==" | "!=" | "<=" | ">=" | "<" | ">") AdditiveExpression
+LogicalExpression ::= EqualityExpression (("and" | "or") EqualityExpression)*
+
+EqualityExpression ::= AdditiveExpression (("==" | "!=" | "<=" | ">=" | "<" | ">") AdditiveExpression)*
 
 AdditiveExpression ::= MultiplicativeExpression (("+" | "-") MultiplicativeExpression)*