use common::base as common ~ = common::whitespaces* program = pest::SOI ~ expr ~ pest::EOI expr = prefix* ~ primary ~ postfix* ~ (infix ~ prefix* ~ primary ~ postfix* )* infix = _{ add | sub | mul | div | pow } add = "+" // Addition sub = "-" // Subtraction mul = "*" // Multiplication div = "/" // Division pow = "^" // Exponentiation prefix = _{ neg } neg = "-" // Negation postfix = _{ fac } fac = "!" // Factorial primary = _{ common::int | "(" ~ expr ~ ")" }