Add operator rule

This commit is contained in:
Greg Shuflin 2021-11-03 22:27:14 -07:00
parent 6cbe562241
commit 54eb8252a9
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ peg::parser! {
rule expression_kind() -> ExpressionKind =
primary()
//TODO maybe make this more complex
rule operator() -> &'input str =
$( ['+' | '-' | '*' | '/' | '%' | '<' | '>' | '=' | '!' | '$' | '&' | '?' | '^' | '`']+ )
rule primary() -> ExpressionKind =
float_literal() / nat_literal() / bool_literal() / string_literal() / paren_expr() /
list_expr()