Re: [vim/vim] patch 9.2.XXXX: line continuation for command arguments is undocumented (PR #21073)

h_east (Vim Github Repository) <[email protected]>
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/21073/[email protected]>
h-east left a comment (vim/vim#21073)

The update addresses the details I listed, but it does so by adding a Vim
script lexer to usercmd.c: string skipping, comment handling and brace
counting.  That is the parsing that the argument of `:command` and `:autocmd`
is defined not to need, so the objection is the same as before.  Three
defects in the new code, as examples of what maintaining that lexer means:

`count_cmd_curly()` always treats `"` as the start of a string.  In legacy
script it starts a comment.  That matters here because the new path is not
limited to Vim9 script: `may_get_cmd_block()` is called from `usercmd.c` and
`autocmd.c` without a Vim9 check, so in legacy script a line such as
`command Foo call Bar('x', {` now starts collecting the following lines when
it did not before.

`#` is taken for a comment whenever `in_vim9script()` is true, without looking
at what precedes it, so an argument such as `s/{/#/` ends the count early.

A `{` that is not a brace, as in `s/{/x/`, keeps the depth above zero, so the
collector reads to the end of the file and reports E1026.

`in_vim9script()` in the counter is also about the script being read, while
the argument may be executed with the other syntax.  That distinction is what
the `UC_VIM9` flag is for.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21073#issuecomment-5318376543
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/21073/[email protected]>

-- 
-- 
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 [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21073/c5318376543%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.