diff options
author | Chimrod <> | 2024-06-20 20:25:19 +0200 |
---|---|---|
committer | Chimrod <> | 2024-06-20 20:25:19 +0200 |
commit | 976f80ed226e53625cd807539b9336f52f6eb091 (patch) | |
tree | dc0d199396c4f5571dffd83e693de2979046d4db /lib/qparser | |
parent | 70c94d9465496340b34a85d0d6c7fc1fa5fdf949 (diff) |
Removed the need for () after rnd
Diffstat (limited to 'lib/qparser')
-rw-r--r-- | lib/qparser/idents.ml | 2 | ||||
-rw-r--r-- | lib/qparser/qsp_expression.mly | 4 | ||||
-rw-r--r-- | lib/qparser/tokens.mly | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lib/qparser/idents.ml b/lib/qparser/idents.ml index f96dd95..be3d76c 100644 --- a/lib/qparser/idents.ml +++ b/lib/qparser/idents.ml @@ -127,7 +127,7 @@ let _ = ("REPLACE", FUNCTION T.Replace); ("$REPLACE", FUNCTION T.Replace'); ("RGB", FUNCTION T.Rgb); - ("RND", FUNCTION T.Rnd); + ("RND", FUNCTION_NOARGS T.Rnd); ("SAVEGAME", KEYWORD T.SaveGame); ("SELACT", FUNCTION T.Selact); ("$SELACT", IDENT "$SELACT"); diff --git a/lib/qparser/qsp_expression.mly b/lib/qparser/qsp_expression.mly index 1e0988f..c6b7564 100644 --- a/lib/qparser/qsp_expression.mly +++ b/lib/qparser/qsp_expression.mly @@ -44,6 +44,10 @@ { (Analyzer.Expression.function_ $loc k arg) } + | k = FUNCTION_NOARGS + { + (Analyzer.Expression.function_ $loc k []) + } literal: | v = LITERAL { Qsp_syntax.T.Text v } | e = delimited(ENTER_EMBED, expression, LEAVE_EMBED) diff --git a/lib/qparser/tokens.mly b/lib/qparser/tokens.mly index 90e9e14..0ba5486 100644 --- a/lib/qparser/tokens.mly +++ b/lib/qparser/tokens.mly @@ -40,6 +40,7 @@ %token NO %token <Qsp_syntax.T.keywords>KEYWORD %token <Qsp_syntax.T.function_>FUNCTION +%token <Qsp_syntax.T.function_>FUNCTION_NOARGS (* (b) if the token was declared left-associative, then the conflict is resolved |