From 54eb8252a9a31049dc0a984f4b2bd55994175a55 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 3 Nov 2021 22:27:14 -0700 Subject: [PATCH] Add operator rule --- schala-lang/language/src/parsing/new.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schala-lang/language/src/parsing/new.rs b/schala-lang/language/src/parsing/new.rs index 7521ae0..181d1a3 100644 --- a/schala-lang/language/src/parsing/new.rs +++ b/schala-lang/language/src/parsing/new.rs @@ -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()