summaryrefslogtreecommitdiff
path: root/examples/calc.pest
diff options
context:
space:
mode:
Diffstat (limited to 'examples/calc.pest')
-rw-r--r--examples/calc.pest5
1 files changed, 1 insertions, 4 deletions
diff --git a/examples/calc.pest b/examples/calc.pest
index 9f2cc3b..3834973 100644
--- a/examples/calc.pest
+++ b/examples/calc.pest
@@ -1,5 +1,3 @@
-WHITESPACE = _{ " " | "\t" | NEWLINE }
-
program = { SOI ~ expr ~ EOI }
expr = { prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix* )* }
infix = _{ add | sub | mul | div | pow }
@@ -12,5 +10,4 @@ WHITESPACE = _{ " " | "\t" | NEWLINE }
neg = { "-" } // Negation
postfix = _{ fac }
fac = { "!" } // Factorial
- primary = _{ int | "(" ~ expr ~ ")" }
- int = @{ (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT+ | ASCII_DIGIT) } \ No newline at end of file
+ primary = _{ int | "(" ~ expr ~ ")" } \ No newline at end of file