forked from aniani/vim
patch 9.1.0378: Vim9: no comments allowed after class vars
Problem: Vim9: no comments allowed after class vars (Christian Robinson, after 9.1.376) Solution: Allow trailing comments after class vars (Yegappan Lakshmanan) closes: #14651 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
1125051040
commit
fe55c31752
@ -103,6 +103,18 @@ def Test_class_basic()
|
|||||||
END
|
END
|
||||||
v9.CheckSourceFailure(lines, "E488: Trailing characters: | var y = 10", 3)
|
v9.CheckSourceFailure(lines, "E488: Trailing characters: | var y = 10", 3)
|
||||||
|
|
||||||
|
# Comments are allowed after an inline block
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
class Foo
|
||||||
|
static const bar = { # {{{
|
||||||
|
baz: 'qux'
|
||||||
|
} # }}}
|
||||||
|
endclass
|
||||||
|
assert_equal({baz: 'qux'}, Foo.bar)
|
||||||
|
END
|
||||||
|
v9.CheckSourceSuccess(lines)
|
||||||
|
|
||||||
# Try to define a class with the same name as an existing variable
|
# Try to define a class with the same name as an existing variable
|
||||||
lines =<< trim END
|
lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
378,
|
||||||
/**/
|
/**/
|
||||||
377,
|
377,
|
||||||
/**/
|
/**/
|
||||||
|
@ -137,7 +137,7 @@ parse_member(
|
|||||||
(void)skip_expr_concatenate(&init_arg, &expr_start, &expr_end, &evalarg);
|
(void)skip_expr_concatenate(&init_arg, &expr_start, &expr_end, &evalarg);
|
||||||
|
|
||||||
init_arg = skipwhite(init_arg);
|
init_arg = skipwhite(init_arg);
|
||||||
if (*init_arg != NUL)
|
if (*init_arg != NUL && !vim9_comment_start(init_arg))
|
||||||
{
|
{
|
||||||
semsg(_(e_trailing_characters_str), init_arg);
|
semsg(_(e_trailing_characters_str), init_arg);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user