viml/parser/expressions,tests: Add AST freeing, with sanity checks

This commit is contained in:
ZyX
2017-10-15 20:05:35 +03:00
parent 206f7ae76a
commit 6c19cbef26
4 changed files with 210 additions and 36 deletions

View File

@@ -358,6 +358,8 @@ format_luav = function(v, indent)
else
ret = ('%e'):format(v)
end
elseif type(v) == 'nil' then
ret = 'nil'
else
print(type(v))
-- Not implemented yet

View File

@@ -92,6 +92,6 @@ int main(const int argc, const char *const *const argv,
assert(ast.root != NULL
|| plines[0].size == 0);
assert(ast.root != NULL || ast.err.msg);
// FIXME: check for AST recursiveness
// FIXME: free memory and assert no memory leaks
viml_pexpr_free_ast(ast);
assert(allocated_memory == 0);
}

View File

@@ -253,6 +253,7 @@ describe('Expressions parser', function()
end
eq(exp_highlighting, hls)
end
lib.viml_pexpr_free_ast(east)
end
local function hl(group, str, shift)
return function(next_col)