Skip to content

Commit 381455d

Browse files
committed
update js
1 parent b1aaecb commit 381455d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

js/vimlparser.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,14 +1454,12 @@ VimLParser.prototype.parse_cmd_function = function() {
14541454
varnode.pos = token.pos;
14551455
varnode.value = token.value;
14561456
viml_add(node.rlist, varnode);
1457-
var pc = this.reader.p(0);
1458-
var ppos = this.reader.getpos();
1457+
// XXX: Vim doesn't skip white space before comma. F(a ,b) => E475
1458+
if (iswhite(this.reader.p(0)) && tokenizer.peek().type == TOKEN_COMMA) {
1459+
throw Err("E475: Invalid argument: White space is not allowed before comma", this.reader.getpos());
1460+
}
14591461
var token = tokenizer.get();
14601462
if (token.type == TOKEN_COMMA) {
1461-
// XXX: Vim doesn't skip white space before comma. F(a ,b) => E475
1462-
if (iswhite(pc)) {
1463-
throw Err("E475: Invalid argument: White space is not allowed before comma", ppos);
1464-
}
14651463
// XXX: Vim allows last comma. F(a, b, ) => OK
14661464
if (tokenizer.peek().type == TOKEN_PCLOSE) {
14671465
tokenizer.get();
@@ -3319,7 +3317,7 @@ StringReader.prototype.__init__ = function(lines) {
33193317
}
33203318
else {
33213319
viml_add(this.buf, c);
3322-
viml_add(this.pos, [lnum + 1, col + 1]);
3320+
viml_add(this.pos, [lnum + 2, col + 1]);
33233321
}
33243322
col += viml_len(c);
33253323
}

0 commit comments

Comments
 (0)