author | Francesco Abbate <francesco.bbt@gmail.com> | 2013年05月13日 15:02:57 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2013年05月13日 15:02:57 +0200 |
commit | 3d10a044ae973e95b2be9980acc52fcc26c21a29 (patch) | |
tree | a8a208de1aa0b22237642f60aaec4c734536d762 /expr-parse.lua | |
parent | 338fd9e668b582105def249a3be6a377d0160272 (diff) | |
download | gsl-shell-3d10a044ae973e95b2be9980acc52fcc26c21a29.tar.gz |
-rw-r--r-- | expr-parse.lua | 15 |
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) |