File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1454,14 +1454,12 @@ VimLParser.prototype.parse_cmd_function = function() {
1454
1454
varnode . pos = token . pos ;
1455
1455
varnode . value = token . value ;
1456
1456
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
+ }
1459
1461
var token = tokenizer . get ( ) ;
1460
1462
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
- }
1465
1463
// XXX: Vim allows last comma. F(a, b, ) => OK
1466
1464
if ( tokenizer . peek ( ) . type == TOKEN_PCLOSE ) {
1467
1465
tokenizer . get ( ) ;
@@ -3319,7 +3317,7 @@ StringReader.prototype.__init__ = function(lines) {
3319
3317
}
3320
3318
else {
3321
3319
viml_add ( this . buf , c ) ;
3322
- viml_add ( this . pos , [ lnum + 1 , col + 1 ] ) ;
3320
+ viml_add ( this . pos , [ lnum + 2 , col + 1 ] ) ;
3323
3321
}
3324
3322
col += viml_len ( c ) ;
3325
3323
}
You can’t perform that action at this time.
0 commit comments