viml/parser/expressions: Start creating expressions parser

Currently supported nodes:

- Register as it is one of the simplest value nodes (even numbers are
  not that simple with that dot handling).
- Plus, both unary and binary.
- Parenthesis, both nesting and calling.

Note regarding unit tests: it stores data for AST in highlighting in
strings in place of tables because luassert fails to do a good job at
representing big tables. Squashing a bunch of data into a single string
simply yields more readable result.
This commit is contained in:
ZyX
2017-09-03 21:58:16 +03:00
parent 919223c23a
commit 430e516d3a
5 changed files with 1615 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
local helpers = require('test.unit.helpers')(nil)
local ptr2key = helpers.ptr2key
local cimport = helpers.cimport
local to_cstr = helpers.to_cstr
local ffi = helpers.ffi
@@ -91,10 +92,6 @@ local function populate_partial(pt, lua_pt, processed)
return pt
end
local ptr2key = function(ptr)
return tostring(ptr)
end
local lst2tbl
local dct2tbl