Add operator rule

This commit is contained in:
Greg Shuflin 2021-11-03 22:27:14 -07:00
parent 6cbe562241
commit 54eb8252a9

View File

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