Reply to message «Re: Vim Script grammer», sent 21:55:42 11 July 2011, Monday by Marc Weber:
Yup I am also thinking of writing LLVM-jit compiler for vimscript.
Some inconsistences that I know, but cannot find in documentation (it does not
mean that they are not there):
1. Inside string literals passed to eval() NL is taken as a part of the string.
In other cases NL terminates line or is a error (thus I have lots of cases
where
I can't safely use string()).
2. Inside :execute line continuation is not possible.
3. Inside :execute commands that take <bar> as their argument also take NL as
their argument.
4. 1. also applies to :execute for some built-in commands.
5. Inside function defined in :execute 3. and 4. does not apply.
command -nargs=1 Echo echo <args>
command -nargs=1 -bar Echo2 echo <args>
execute "function Normal()\nnormal! oabc\ndef\nendfunction"
execute "function Echo()\necho 'abc\ndef'\nendfunction"
execute "Echo 'abc\ndef'" | " Echoes «abc» and «def» on separate lines
execute "Echo2 'abc\ndef'" | " Error
execute "echo'a\nd'|echo'g'" | " Echoes «a», «d» and «g» on separate lines
execute "normal! oabc\ndef" | " Adds two lines: «abc» and «def»
call Normal() | " Error E492: no such command: «def»
call Echo() | " Error E115: missing single quote
Original message:
> Excerpts from Charles Strahan's message of Mon Jul 11 17:53:52 +0200 2011:
> > (Searching for "vim script grammar/parser" brings up grammars/parsers
> > written _in_ vim script, unfortunately...)
>
> I don't think so. I've never heared about one. Its also not consistent.
> eg eval() behaves differently than sourcing VimL code if you use line
> continuation or such.
>
> What are you trying to do exactly?
>
> Marc Weber
signature.asc
Description: This is a digitally signed message part.
