aboutsummaryrefslogtreecommitdiff
path: root/test/unit/viml/expressions/parser_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/viml/expressions/parser_spec.lua')
-rw-r--r--test/unit/viml/expressions/parser_spec.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua
index d95eaca79b..407114ff33 100644
--- a/test/unit/viml/expressions/parser_spec.lua
+++ b/test/unit/viml/expressions/parser_spec.lua
@@ -4241,6 +4241,40 @@ describe('Expressions parser', function()
hl('UnaryPlus', '+', 1),
hl('Identifier', 'b'),
})
+
+ check_parsing('a. b', 0, {
+ -- 0123
+ ast = {
+ {
+ 'Concat:0:1:.',
+ children = {
+ 'PlainIdentifier(scope=0,ident=a):0:0:a',
+ 'PlainIdentifier(scope=0,ident=b):0:2: b',
+ },
+ },
+ },
+ }, {
+ hl('Identifier', 'a'),
+ hl('ConcatOrSubscript', '.'),
+ hl('Identifier', 'b', 1),
+ })
+
+ check_parsing('a. 1', 0, {
+ -- 0123
+ ast = {
+ {
+ 'Concat:0:1:.',
+ children = {
+ 'PlainIdentifier(scope=0,ident=a):0:0:a',
+ 'Integer(val=1):0:2: 1',
+ },
+ },
+ },
+ }, {
+ hl('Identifier', 'a'),
+ hl('ConcatOrSubscript', '.'),
+ hl('Number', '1', 1),
+ })
end)
itp('works with bracket subscripts', function()
check_parsing(':', 0, {
@@ -6823,4 +6857,14 @@ describe('Expressions parser', function()
hl('Number', '2'),
})
end)
+ itp('works (KLEE tests)', function()
+ check_parsing('\0002&A:\000', 0, {
+ ast = nil,
+ err = {
+ arg = '',
+ msg = 'E15: Expected value, got EOC: %.*s',
+ },
+ }, {
+ })
+ end)
end)