gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/expr-actions.lua
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2013年05月13日 18:20:21 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2013年05月13日 18:20:21 +0200
commit8609bf03ac6479678c489c559a8596ef6488af20 (patch)
treeee798c4ced7a8d15189eaad13f3a6ed39bfb3e33 /expr-actions.lua
parent3401c496044f22a9b4b57950e526cbe21e2077f4 (diff)
downloadgsl-shell-8609bf03ac6479678c489c559a8596ef6488af20.tar.gz
Implement string literals in gdt expression parser
Diffstat (limited to 'expr-actions.lua')
-rw-r--r--expr-actions.lua 5
1 files changed, 5 insertions, 0 deletions
diff --git a/expr-actions.lua b/expr-actions.lua
index 8ba169a1..3e82cf1c 100644
--- a/expr-actions.lua
+++ b/expr-actions.lua
@@ -29,6 +29,10 @@ end
local function ident_action(id) return id end
+local function literal_action(name)
+ return {literal= name}
+end
+
-- return true iff expr is a variable (with enums or not).
-- if it is a variable returns, in addition, the var_name and the enumeration flag
local function is_variable(expr)
@@ -47,6 +51,7 @@ end
return {
infix = infix_action,
ident = ident_action,
+ literal = literal_action,
prefix = prefix_action,
enum = enum_action,
func_eval = func_eval_action,
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月13日 13:10:32 +0000

AltStyle によって変換されたページ (->オリジナル) /