aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-11-08 22:53:41 +0100
committerWilliam Hergès <william@herges.fr>2025-11-08 22:53:41 +0100
commitc7a26d3c6125caa9239cec9bf08db935d98e19c1 (patch)
tree77222ae3903da80d619d7a33d307d0d46c4eb9bb /src
parentf52f066e7cf6b4c96e452a8f7e803d7f1895e9a1 (diff)
feat(syntax): eval statement
Diffstat (limited to 'src')
-rw-r--r--src/elixir_math_parser.yrl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/elixir_math_parser.yrl b/src/elixir_math_parser.yrl
index 3ec4946..17b46ad 100644
--- a/src/elixir_math_parser.yrl
+++ b/src/elixir_math_parser.yrl
@@ -31,11 +31,12 @@ Left 600 '('.
root -> statements : '$1'.
-statements -> statement : '$1'.
-statements -> statement statements : lists:merge('$1', '$2').
-statements -> statement ';;' statements : lists:merge('$1', '$3').
+statements -> statement : ['$1'].
+statements -> statement statements : ['$1'|'$2'].
+statements -> statement ';;' statements : ['$1'|'$3'].
-statement -> atom '=' expr : [{assign, '$1', '$3'}].
+statement -> atom '=' expr : {assign, '$1', '$3'}.
+statement -> expr : {eval, '$1'}.
expr -> int : unwrap('$1').
expr -> atom : '$1'.