[vim/vim] Parsing error with heredoc that contains keywords such as change, append, insert, etc. (Issue #9074)

16 views
Skip to first unread message

Jongwook Choi

unread,
Oct 31, 2021, 6:33:56 PM10/31/21
to vim/vim, Subscribed

Steps to reproduce

$ vim -u NONE
:source foo.vim

foo.vim:

function RunLua() abort
lua<<EOF
local foo = {
    change = {},
    insert = {},
    append = {},
}
EOF
endfunction

What happens:

E126: Missing :endfunction

Expected behaviour

The heredoc block should run without any errors -- even if the heredoc script contains a word like change, append, insert, etc. Those words are some kind of special directives (see :lua-heredoc) but they impact on parsing function ... endfunction blocks.

Operating system

macOS

Version of Vim

Vim 8.2 and Nightly

Logs and stack traces

See https://github.com/neovim/neovim/issues/16136 for the downstream issue on Neovim. I believe this is a vim bug.

Implementation of parsing heredoc: https://github.com/vim/vim/blob/master/src/userfunc.c#L940


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Yegappan Lakshmanan

unread,
Nov 5, 2021, 9:26:07 PM11/5/21
to vim_dev, reply+ACY5DGBM2NA4NI7QUV...@reply.github.com, vim/vim, Subscribed
Hi,

I am not able to reproduce this problem with the latest version of Vim (with one minor modification
described below). Can you try to reproduce this problem with the latest version of Vim?

On Sun, Oct 31, 2021 at 3:33 PM Jongwook Choi <vim-dev...@256bit.org> wrote:

Steps to reproduce

$ vim -u NONE
:source foo.vim

foo.vim:

function RunLua() abort
lua<<EOF

You should add a space around "<<".

- Yegappan

vim-dev ML

unread,
Nov 5, 2021, 9:26:21 PM11/5/21
to vim/vim, vim-dev ML, Your activity

Hi,

I am not able to reproduce this problem with the latest version of Vim
(with one minor modification
described below). Can you try to reproduce this problem with the latest
version of Vim?

On Sun, Oct 31, 2021 at 3:33 PM Jongwook Choi ***@***.***>
wrote:


> Steps to reproduce
>
> $ vim -u NONE
> :source foo.vim
>
> foo.vim:
>
> function RunLua() abort
> lua<<EOF
>
>
You should add a space around "<<".

- Yegappan


>

zeertzjq

unread,
Nov 5, 2021, 10:32:02 PM11/5/21
to vim/vim, vim-dev ML, Comment

Indeed, when lua<<EOF is changed to lua <<EOF the error can no longer be reproduced in either Vim or Nvim.


You are receiving this because you commented.

zeertzjq

unread,
Nov 5, 2021, 10:33:49 PM11/5/21
to vim/vim, vim-dev ML, Comment

And this is also what the documentation says:

:[range]lua << [endmarker]
{script}
{endmarker}


You are receiving this because you commented.

Christian Brabandt

unread,
Nov 6, 2021, 3:27:42 AM11/6/21
to vim/vim, vim-dev ML, Comment

closing then.


You are receiving this because you commented.

Christian Brabandt

unread,
Nov 6, 2021, 3:27:44 AM11/6/21
to vim/vim, vim-dev ML, Comment

Closed #9074.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages