diff options
author | ZyX <kp-pav@yandex.ru> | 2017-09-26 00:28:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-10-08 22:25:06 +0300 |
commit | d4782fb1ca05e76095086bdcbc8dcea47f532d00 (patch) | |
tree | 1778a15e7e8ed561abd11dcb84fc3d395d70c261 /test/unit/viml/expressions/parser_spec.lua | |
parent | 7980614650f0aedb39bf88466e5bd3ce90429cc1 (diff) | |
download | rneovim-d4782fb1ca05e76095086bdcbc8dcea47f532d00.tar.gz rneovim-d4782fb1ca05e76095086bdcbc8dcea47f532d00.tar.bz2 rneovim-d4782fb1ca05e76095086bdcbc8dcea47f532d00.zip |
viml/parser/expressions: Make commas actually work when calling
Diffstat (limited to 'test/unit/viml/expressions/parser_spec.lua')
-rw-r--r-- | test/unit/viml/expressions/parser_spec.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua index 63b8baa8a8..4d4a5f1007 100644 --- a/test/unit/viml/expressions/parser_spec.lua +++ b/test/unit/viml/expressions/parser_spec.lua @@ -901,6 +901,48 @@ describe('Expressions parser', function() hl('CallingParenthesis', '('), hl('Register', '@b'), }) + check_parsing('@a(@b, @c, @d, @e)', 0, { + -- 012345678901234567 + -- 0 1 + ast = { + { + 'Call:0:2:(', + children = { + 'Register(name=a):0:0:@a', + { + 'Comma:0:5:,', + children = { + 'Register(name=b):0:3:@b', + { + 'Comma:0:9:,', + children = { + 'Register(name=c):0:6: @c', + { + 'Comma:0:13:,', + children = { + 'Register(name=d):0:10: @d', + 'Register(name=e):0:14: @e', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, { + hl('Register', '@a'), + hl('CallingParenthesis', '('), + hl('Register', '@b'), + hl('Comma', ','), + hl('Register', '@c', 1), + hl('Comma', ','), + hl('Register', '@d', 1), + hl('Comma', ','), + hl('Register', '@e', 1), + hl('CallingParenthesis', ')'), + }) end) itp('works with identifiers', function() check_parsing('var', 0, { |