gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/expr-parse.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-parse.lua
parent3401c496044f22a9b4b57950e526cbe21e2077f4 (diff)
downloadgsl-shell-8609bf03ac6479678c489c559a8596ef6488af20.tar.gz
Implement string literals in gdt expression parser
Diffstat (limited to 'expr-parse.lua')
-rw-r--r--expr-parse.lua 4
1 files changed, 4 insertions, 0 deletions
diff --git a/expr-parse.lua b/expr-parse.lua
index 85e770e9..a8e72481 100644
--- a/expr-parse.lua
+++ b/expr-parse.lua
@@ -28,6 +28,10 @@ local function factor(lexer, actions)
else
return actions.ident(id)
end
+ elseif token.type == 'literal' then
+ local x = token.value
+ lexer:next()
+ return actions.literal(x)
elseif token.type == 'number' then
local x = token.value
lexer:next()
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月15日 05:11:32 +0000

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