Skip to content

Commit b1aaecb

Browse files
committed
update py
1 parent 7fed007 commit b1aaecb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

py/vimlparser.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,13 +1183,11 @@ def parse_cmd_function(self):
11831183
varnode.pos = token.pos
11841184
varnode.value = token.value
11851185
viml_add(node.rlist, varnode)
1186-
pc = self.reader.p(0)
1187-
ppos = self.reader.getpos()
1186+
# XXX: Vim doesn't skip white space before comma. F(a ,b) => E475
1187+
if iswhite(self.reader.p(0)) and tokenizer.peek().type == TOKEN_COMMA:
1188+
raise VimLParserException(Err("E475: Invalid argument: White space is not allowed before comma", self.reader.getpos()))
11881189
token = tokenizer.get()
11891190
if token.type == TOKEN_COMMA:
1190-
# XXX: Vim doesn't skip white space before comma. F(a ,b) => E475
1191-
if iswhite(pc):
1192-
raise VimLParserException(Err("E475: Invalid argument: White space is not allowed before comma", ppos))
11931191
# XXX: Vim allows last comma. F(a, b, ) => OK
11941192
if tokenizer.peek().type == TOKEN_PCLOSE:
11951193
tokenizer.get()
@@ -2673,7 +2671,7 @@ def __init__(self, lines):
26732671
skip = 0
26742672
else:
26752673
viml_add(self.buf, c)
2676-
viml_add(self.pos, [lnum + 1, col + 1])
2674+
viml_add(self.pos, [lnum + 2, col + 1])
26772675
col += viml_len(c)
26782676
lnum += 1
26792677
viml_add(self.buf, "<EOL>")

0 commit comments

Comments
 (0)