Re: Commit: patch 9.1.0376: Vim9: Trailing commands after class/enum keywords ignored

2024-04-27 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Sat, Apr 27, 2024 at 10:08 AM Christian J. Robinson
 wrote:
>
> I think this patch, or one of the others around this same time, broke adding 
> comments after "}", as in the following:
>
> vim9script
>
> class Foo
> static const bar = { # {{{
> baz: 'qux'
> } # }}}
> endclass
>
> Results in:
>
> Error detected while processing C:\Users\hepti\comment.vim:
> line6:
> E488: Trailing characters: # }}}
>

Thanks for reporting the issue.  I have created a  PR
(https://github.com/vim/vim/pull/14651) to address this issue.

Regards,
Yegappan

> On Sat, Apr 27, 2024 at 4:00 AM Christian Brabandt  wrote:
>>
>> patch 9.1.0376: Vim9: Trailing commands after class/enum keywords ignored
>>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7mAZ%2BVcBXDb35dVecyyf7SfY5jSNg9_Ag80QJS%3Dxgb_KQ%40mail.gmail.com.


Re: Commit: patch 9.1.0376: Vim9: Trailing commands after class/enum keywords ignored

2024-04-27 Fir de Conversatie Christian J. Robinson
I think this patch, or one of the others around this same time, broke
adding comments after "}", as in the following:

vim9script

class Foo
static const bar = { # {{{
baz: 'qux'
} # }}}
endclass

Results in:

Error detected while processing C:\Users\hepti\comment.vim:
line6:
E488: Trailing characters: # }}}

On Sat, Apr 27, 2024 at 4:00 AM Christian Brabandt 
wrote:

> patch 9.1.0376: Vim9: Trailing commands after class/enum keywords ignored
>
> Commit:
> https://github.com/vim/vim/commit/ac7731895c996acef4d02b784f9952749226e203
> Author: Yegappan Lakshmanan 
> Date:   Sat Apr 27 11:36:12 2024 +0200
>
> patch 9.1.0376: Vim9: Trailing commands after class/enum keywords
> ignored
>
> Problem:  Vim9: Trailing commands after class/enum keywords ignored
> Solution: Remove EX_TRLBAR keyword from command definition
>   (Yegappan Lakshmanan)
>
> closes: #14649
>
> Signed-off-by: Yegappan Lakshmanan 
> Signed-off-by: Christian Brabandt 
>
> diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
> index 13c4d729b..6a7515a76 100644
> --- a/runtime/doc/cmdline.txt
> +++ b/runtime/doc/cmdline.txt
> @@ -1,4 +1,4 @@
> -*cmdline.txt*   For Vim version 9.1.  Last change: 2023 Dec 09
> +*cmdline.txt*   For Vim version 9.1.  Last change: 2024 Apr 27
>
>
>   VIM REFERENCE MANUALby Bram Moolenaar
> @@ -650,6 +650,12 @@ followed by another Vim command:
>  :[range]!
>  a user defined command without the "-bar" argument |:command|
>
> +and the following |Vim9-script| keywords:
> +:abstract
> +:class
> +:enum
> +:interface
> +
>  Note that this is confusing (inherited from Vi): With ":g" the '|' is
> included
>  in the command, with ":s" it is not.
>
> diff --git a/src/ex_cmds.h b/src/ex_cmds.h
> index 70e57708f..40dec4ce4 100644
> --- a/src/ex_cmds.h
> +++ b/src/ex_cmds.h
> @@ -129,7 +129,7 @@ EXCMD(CMD_aboveleft,"aboveleft",
> ex_wrongmodifier,
> EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
> ADDR_NONE),
>  EXCMD(CMD_abstract,"abstract", ex_class,
> -   EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> +   EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> ADDR_NONE),
>  EXCMD(CMD_all, "all",  ex_all,
> EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR,
> @@ -357,7 +357,7 @@ EXCMD(CMD_clast,"clast",ex_cc,
> EX_RANGE|EX_COUNT|EX_TRLBAR|EX_BANG,
> ADDR_UNSIGNED),
>  EXCMD(CMD_class,   "class",ex_class,
> -   EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> +   EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> ADDR_NONE),
>  EXCMD(CMD_close,   "close",ex_close,
> EX_BANG|EX_RANGE|EX_COUNT|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
> @@ -597,7 +597,7 @@ EXCMD(CMD_enew, "enew", ex_edit,
> EX_BANG|EX_TRLBAR,
> ADDR_NONE),
>  EXCMD(CMD_enum,"enum", ex_class,
> -   EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> +   EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> ADDR_NONE),
>  EXCMD(CMD_eval,"eval", ex_eval,
> EX_EXTRA|EX_NOTRLCOM|EX_EXPR_ARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK,
> @@ -759,7 +759,7 @@ EXCMD(CMD_intro,"intro",ex_intro,
> EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK,
> ADDR_NONE),
>  EXCMD(CMD_interface,   "interface",ex_class,
> -   EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> +   EX_EXTRA|EX_CMDWIN|EX_LOCK_OK|EX_EXPORT,
> ADDR_NONE),
>  EXCMD(CMD_isearch, "isearch",  ex_findpat,
>
> EX_BANG|EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_LOCK_OK,
> diff --git a/src/testdir/test_vim9_class.vim
> b/src/testdir/test_vim9_class.vim
> index 5957f57ae..bd06c6e28 100644
> --- a/src/testdir/test_vim9_class.vim
> +++ b/src/testdir/test_vim9_class.vim
> @@ -67,6 +67,42 @@ def Test_class_basic()
>END
>v9.CheckSourceFailure(lines, "E488: Trailing characters: | echo
> 'done'", 3)
>
> +  # Additional command after "class name"
> +  lines =<< trim END
> +vim9script
> +class Something | var x = 10
> +endclass
> +  END
> +  v9.CheckSourceFailure(lines, "E488: Trailing characters: | var x = 10",
> 2)
> +
> +  # Additional command after "object variable"
> +  lines =<< trim END
> +vim9script
> +class Something
> +  var l: list = [] | var y = 10
> +endclass
> +  END
> +  v9.CheckSourceFailure(lines, "E488: Trailing characters: | var y = 10",
> 3)
> +
> +  # Additional command after "class variable"
> +  lines =<< trim END
> +vim9script
> +class Something
> +  static var d = {a: 10} | var y = 10
> +endclass
> +  END
> +  v9.CheckSourceFailure(lines, "E488: Trailing characters: | var y = 10",
> 3)
> +
> +  # Additional command after "object method"
> +  lines =<< trim END
> +vim9script
> +class Something
> +  def Foo() | var y = 10
> +  enddef
> +endclass
> +  END
> +  v9.CheckSourceFailure(lines, "E488: Trailing