Skip to content

A strange parsing error with heredoc without whitespace (lua<<EOF instead of lua << EOF) #16136

@wookayin

Description

@wookayin

Neovim version (nvim -v)

v0.6.0-dev+1976-gcb15055c2

Vim (not Nvim) behaves the same?

Yes, Vim 8.2.0000

Operating system/version

macOS 11.6

Terminal name/version

xterm

$TERM environment variable

xterm-256color

Installation

homebrew

How to reproduce the issue

nvim --clean
source foo.vim

foo.vim:

function! s:setup_gitsigns() abort
lua<<EOF
require('gitsigns').setup {
  signs = {
    change       = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
  },
}
EOF
endfunction

Expected behavior

There should be no errors in parsing.

Actual behavior

Error detected while processing f.vim:                                                                                                         
line   10:
E126: Missing :endfunction

Note: removing the following line, or replacing the word change with something else will make the error not happen.

    change       = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},

Is there any special thing about change in parsing heredoc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-vimwrong behavior inherited from vimneeds:vim-patchupstream issue that must be fixed in Vim firstvimscript

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions