Skip to content

Commit 2198fc3

Browse files
committed
update js
1 parent 3925c88 commit 2198fc3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

js/vimlparser.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,12 +1454,14 @@ VimLParser.prototype.parse_cmd_function = function() {
14541454
varnode.pos = token.pos;
14551455
varnode.value = token.value;
14561456
viml_add(node.rlist, varnode);
1457-
// XXX: Vim doesn't skip white space before comma. F(a ,b) => E475
1458-
if (iswhite(this.reader.p(0))) {
1459-
throw Err(viml_printf("unexpected token: %s", this.reader.p(0)), this.reader.getpos());
1460-
}
1457+
var pc = this.reader.p(0);
1458+
var ppos = this.reader.getpos();
14611459
var token = tokenizer.get();
14621460
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+
}
14631465
// XXX: Vim allows last comma. F(a, b, ) => OK
14641466
if (tokenizer.peek().type == TOKEN_PCLOSE) {
14651467
tokenizer.get();

0 commit comments

Comments
 (0)