bin op stuff

This commit is contained in:
2026-05-21 07:23:11 +02:00
parent 0878b9f0b9
commit 197afbfb35
5 changed files with 45 additions and 157 deletions
+32 -61
View File
@@ -513,23 +513,6 @@ decrement = {
"--"
}
compound_assign = {
"="
| "+="
| "-="
| "/="
| "%="
| "&="
| "|="
| "^="
| "<<="
| ">>="
}
assign = {
compound_assign ~ expr
}
postfix = {
field_px
| call_px
@@ -540,7 +523,6 @@ postfix = {
| try_px
| increment
| decrement
| assign
}
// ------------------------------------------------------
@@ -564,51 +546,40 @@ prefix = {
}
// ------------------------------------------------------
// OPERATORS (Arranged carefully for PEG priority matching)
// OPERATORS
// ------------------------------------------------------
shl = { "<<" }
shr = { ">>" }
range_inc = { "..=" }
range_exc = { ".." }
lte = { "<=" }
gte = { ">=" }
eq = { "==" }
neq = { "!=" }
and = { "&&" }
or = { "||" }
add = { "+" }
sub = { "-" }
mul = { "*" }
div = { "/" }
rem = { "%" }
lt = { "<" }
gt = { ">" }
bitand = { "&" }
bitor = { "|" }
bitxor = { "^" }
bin_op = _{
shl
| shr
| range_inc
| range_exc
| lte
| gte
| eq
| neq
| and
| or
| lt
| gt
| add
| sub
| mul
| div
| rem
| bitand
| bitor
| bitxor
bin_op = {
"+="
| "-="
| "/="
| "%="
| "&="
| "|="
| "^="
| "<<="
| ">>="
| "<<"
| ">>"
| "..="
| ".."
| "<="
| ">="
| "=="
| "!="
| "&&"
| "||"
| "+"
| "-"
| "*"
| "/"
| "%"
| "<"
| ">"
| "&"
| "|"
| "^"
| "="
}
// ------------------------------------------------------