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日 15:02:57 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2013年05月13日 15:02:57 +0200
commit3d10a044ae973e95b2be9980acc52fcc26c21a29 (patch)
treea8a208de1aa0b22237642f60aaec4c734536d762 /expr-parse.lua
parent338fd9e668b582105def249a3be6a377d0160272 (diff)
downloadgsl-shell-3d10a044ae973e95b2be9980acc52fcc26c21a29.tar.gz
Fix problems with plot implementation vs new expression parser
Diffstat (limited to 'expr-parse.lua')
-rw-r--r--expr-parse.lua 15
1 files changed, 15 insertions, 0 deletions
diff --git a/expr-parse.lua b/expr-parse.lua
index 20129478..85e770e9 100644
--- a/expr-parse.lua
+++ b/expr-parse.lua
@@ -135,6 +135,16 @@ local function schema(lexer, actions, accept_enums)
return actions.schema(x, y, conds, enums)
end
+local function schema_multivar(lexer, actions)
+ local y = expr_list(lexer, actions, 0)
+ expect(lexer, '~')
+ local x = expr_list(lexer, actions)
+ local enums = enums(lexer, actions)
+ local conds = conditions(lexer, actions)
+ expect(lexer, 'EOF')
+ return actions.schema(x, y, conds, enums)
+end
+
local expr_parse = {}
function expr_parse.schema(formula, actions, accept_enums)
@@ -142,6 +152,11 @@ function expr_parse.schema(formula, actions, accept_enums)
return schema(l, actions, accept_enums)
end
+function expr_parse.schema_multivar(formula, actions)
+ local l = expr_lexer.new(formula)
+ return schema_multivar(l, actions)
+end
+
function expr_parse.expr(formula, actions)
local l = expr_lexer.new(formula)
return expr(l, actions, 0)
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月13日 06:45:54 +0000

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