diff options
author | ZyX <kp-pav@yandex.ru> | 2017-10-09 02:55:56 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-10-15 19:13:52 +0300 |
commit | fa3cfc0dd54df125a1dbabccda47a5f45dc483ae (patch) | |
tree | be4c707c2bdfda3fab439d48b5ed9a5a93eb4856 /test/unit/viml/expressions/parser_spec.lua | |
parent | af38cea133f5ebb67208cedd289e408cd1dad15a (diff) | |
download | rneovim-fa3cfc0dd54df125a1dbabccda47a5f45dc483ae.tar.gz rneovim-fa3cfc0dd54df125a1dbabccda47a5f45dc483ae.tar.bz2 rneovim-fa3cfc0dd54df125a1dbabccda47a5f45dc483ae.zip |
viml/parser/expressions: Finish parser
Note: formatc.lua was unable to swallow some newer additions to ExprASTNodeType
(specifically `kExprNodeOr = '|'` and probably something else), so all `= …`
were dropped: in any case they only were there in order to not bother updating
viml_pexpr_debug_print_ast_node and since it is now known all nodes which will
be present it is not much of an issue.
Diffstat (limited to 'test/unit/viml/expressions/parser_spec.lua')
-rw-r--r-- | test/unit/viml/expressions/parser_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua index ed77a7cba4..5041708a3e 100644 --- a/test/unit/viml/expressions/parser_spec.lua +++ b/test/unit/viml/expressions/parser_spec.lua @@ -93,6 +93,16 @@ make_enum_conv_tab(lib, { 'kExprNodeFloat', 'kExprNodeSingleQuotedString', 'kExprNodeDoubleQuotedString', + 'kExprNodeOr', + 'kExprNodeAnd', + 'kExprNodeUnaryMinus', + 'kExprNodeBinaryMinus', + 'kExprNodeNot', + 'kExprNodeMultiplication', + 'kExprNodeDivision', + 'kExprNodeMod', + 'kExprNodeOption', + 'kExprNodeEnvironment', }, 'kExprNode', function(ret) east_node_type_tab = ret end) local function conv_east_node_type(typ) @@ -149,6 +159,15 @@ local function eastnode2lua(pstate, eastnode, checked_nodes) local s = ffi.string(eastnode.data.str.value, eastnode.data.str.size) typ = format_string('%s(val=%q)', typ, s) end + elseif typ == 'Option' then + typ = ('%s(scope=%s,ident=%s)'):format( + typ, + tostring(intchar2lua(eastnode.data.opt.scope)), + ffi.string(eastnode.data.opt.ident, eastnode.data.opt.ident_len)) + elseif typ == 'Environment' then + typ = ('%s(ident=%s)'):format( + typ, + ffi.string(eastnode.data.env.ident, eastnode.data.env.ident_len)) end ret_str = typ .. ':' .. ret_str local can_simplify = true |