[vim/vim] Comment parsing inconsistency in vim9script (Issue #19484)

5 views
Skip to first unread message

Mao-Yining

unread,
10:33 AM (12 hours ago) 10:33 AM
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#19484)

Steps to reproduce

The following code works as expected:

vim9script
printf( # comment
    'sdfl'
)

But this similar code inside a lambda fails:

vim9script
const a = () => {
    printf( # comment
        'sdfl'
    )
}

Error: The comment # comment is not properly ignored when inside a block context, causing a syntax error.

Expected behaviour

Expected behavior: Comments should be ignored consistently regardless of context.

Version of Vim

9.2.0043

Environment

MS-Windows


@yegappan


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19484@github.com>

h_east

unread,
2:23 PM (8 hours ago) 2:23 PM
to vim/vim, Subscribed
h-east left a comment (vim/vim#19484)
diff --git a/src/vim9expr.c b/src/vim9expr.c
index ebab9ec13..89219996e 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -1392,7 +1392,6 @@ compile_call(
     else
 	*arg += varlen + 1;
 
-    *arg = skipwhite(*arg);
     if (compile_arguments(arg, cctx, &argcount, special_fn) == FAIL)
 	goto theend;
 


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19484/3941565208@github.com>

Reply all
Reply to author
Forward
0 new messages