gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/expr-print.lua
diff options
context:
space:
mode:
Diffstat (limited to 'expr-print.lua')
-rw-r--r--expr-print.lua 6
1 files changed, 6 insertions, 0 deletions
diff --git a/expr-print.lua b/expr-print.lua
index ebbc6518..4c73f44d 100644
--- a/expr-print.lua
+++ b/expr-print.lua
@@ -38,6 +38,8 @@ ex_print = function(e)
local s = e
if not is_ident_simple(s) then s = format('[%s]', s) end
return s, 3
+ elseif e.literal then
+ return format('%q', e.literal)
elseif e.func then
local arg_str = ex_print(e.arg)
return format('%s(%s)', e.func, arg_str), 3
@@ -72,6 +74,8 @@ local function eval(expr, scope, ...)
return expr
elseif type(expr) == 'string' then
return scope.ident(expr, ...)
+ elseif expr.literal then
+ return expr.literal
elseif expr.func then
local arg_value = eval(expr.arg, scope, ...)
if arg_value then
@@ -99,6 +103,8 @@ local function ref_list_rec(expr, list)
return
elseif type(expr) == 'string' then
list[expr] = true
+ elseif expr.literal then
+ return
elseif expr.func then
ref_list_rec(expr.arg, list)
else
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月18日 11:32:37 +0000

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