Working binary operations

This commit is contained in:
2026-04-14 05:03:12 +02:00
parent 5a52582977
commit 7b8010abbb
3 changed files with 48 additions and 17 deletions
+10 -5
View File
@@ -95,13 +95,18 @@ primary = {
}
postfix = {
("." ~ identifier)
| ("(" ~ (expr ~ ("," ~ expr)*)? ~ ")")
| ("[" ~ expr ~ "]")
| ("++" | "--")
| (("+" | "-" | "*" | "/" | "%") ~ primary)
field_px
| call_px
| index_px
| binary_px
}
field_px = { "." ~ identifier }
call_px = { "(" ~ (expr ~ ("," ~ expr)*)? ~ ")" }
index_px = { "[" ~ expr ~ "]" }
binary_px = { bin_op ~ expr }
bin_op = { "+" | "-" | "*" | "/" | "%" }
expr = {
primary ~ postfix*
}