summaryrefslogtreecommitdiff
path: root/server/src/parser/grammar.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/parser/grammar.lua')
-rw-r--r--server/src/parser/grammar.lua29
1 files changed, 15 insertions, 14 deletions
diff --git a/server/src/parser/grammar.lua b/server/src/parser/grammar.lua
index b5e083e6..00c3dbdb 100644
--- a/server/src/parser/grammar.lua
+++ b/server/src/parser/grammar.lua
@@ -184,18 +184,18 @@ UnaryList <- NOT
/ '~' !'='
POWER <- Sp {'^'}
-BinaryOp <- {} {'or'} Cut
- / {} {'and'} Cut
- / {} {'<=' / '>=' / '<'!'<' / '>'!'>' / '~=' / '=='}
- / {} {'|'}
- / {} {'~'}
- / {} {'&'}
- / {} {'<<' / '>>'}
- / {} {'..'} !'.'
- / {} {'+' / '-'}
- / {} {'*' / '//' / '/' / '%'}
- / {} {'^'}
-UnaryOp <- {} {'not' Cut / '#' / '~' / '-'}
+BinaryOp <- Sp {} {'or'} Cut
+ / Sp {} {'and'} Cut
+ / Sp {} {'<=' / '>=' / '<'!'<' / '>'!'>' / '~=' / '=='}
+ / Sp {} {'|'}
+ / Sp {} {'~'}
+ / Sp {} {'&'}
+ / Sp {} {'<<' / '>>'}
+ / Sp {} {'..'} !'.'
+ / Sp {} {'+' / '-'}
+ / Sp {} {'*' / '//' / '/' / '%'}
+ / Sp {} {'^'}
+UnaryOp <- Sp {} {'not' Cut / '#' / '~' !'=' / '-' !'-'}
PL <- Sp '('
PR <- Sp ')'
@@ -290,9 +290,10 @@ DirtyName <- {} -> DirtyName
]]
grammar 'Exp' [[
-Exp <- ((Sp (UnaryOp / ExpUnit Sp BinaryOp))+ (Sp ExpUnit / {}->DirtyExp))
+Exp <- (UnUnit (BinaryOp (UnUnit / {} -> DirtyExp))*)
-> Exp
- / Sp ExpUnit
+UnUnit <- ExpUnit
+ / UnaryOp+ (ExpUnit / {} -> DirtyExp)
ExpUnit <- Nil
/ Boolean
/ String