@@ -747,7 +747,7 @@ function! s:VimLParser.parse_command()
747747 let self .ea .forceit = s: FALSE
748748 endif
749749
750- if self .ea .cmd.flags !~# ' \<BANG\>' && self .ea .forceit && self .ea .cmd.flags !~# ' USERCMD'
750+ if self .ea .cmd.flags !~# ' \<BANG\>' && self .ea .forceit && self .ea .cmd.flags !~# ' \< USERCMD\> '
751751 throw s: Err (' E477: No ! allowed' , self .ea .cmdpos)
752752 endif
753753
@@ -798,16 +798,9 @@ function! s:VimLParser.parse_command()
798798 call self .parse_argcmd ()
799799 endif
800800
801- " call self[self.ea.cmd.parser]()
802801 call self ._parse_command (self .ea .cmd.parser)
803802endfunction
804803
805- " let s:parsers = sort(keys(filter(copy(s:VimLParser), { k -> k =~# '\v^parse_(win)?cmd' })))
806- " for s:parser in s:parsers
807- " echo printf("elseif a:parser == '%s'", s:parser)
808- " echo printf(" call self.%s()", s:parser)
809- " endfor
810- " echo 'endif'
811804function ! s: VimLParser ._parse_command (parser) abort
812805 if a: parser == ' parse_cmd_append'
813806 call self .parse_cmd_append ()
@@ -901,6 +894,8 @@ function! s:VimLParser._parse_command(parser) abort
901894 call self .parse_wincmd ()
902895 elseif a: parser == ' parse_cmd_syntax'
903896 call self .parse_cmd_syntax ()
897+ else
898+ throw printf (' unknown parser: %s' , string (a: parser ))
904899 endif
905900endfunction
906901
@@ -1240,7 +1235,6 @@ function! s:VimLParser.parse_cmd_loadkeymap()
12401235endfunction
12411236
12421237function ! s: VimLParser .parse_cmd_lua ()
1243- let cmdline = ' '
12441238 let lines = []
12451239 call self .reader.skip_white ()
12461240 if self .reader.peekn (2 ) == # ' <<'
@@ -3709,13 +3703,15 @@ function! s:LvalueParser.parse_lv8()
37093703 endif
37103704 endif
37113705 let left = node
3706+ unlet node
37123707 elseif ! s: iswhite (c ) && token.type == s: TOKEN_DOT
37133708 let node = self .parse_dot (token, left )
37143709 if node is s: NIL
37153710 call self .reader.seek_set (pos)
37163711 break
37173712 endif
37183713 let left = node
3714+ unlet node
37193715 else
37203716 call self .reader.seek_set (pos)
37213717 break
@@ -4038,50 +4034,73 @@ function! s:Compiler.compile(node)
40384034 return self .compile_toplevel (a: node )
40394035 elseif a: node .type == s: NODE_COMMENT
40404036 call self .compile_comment (a: node )
4037+ return s: NIL
40414038 elseif a: node .type == s: NODE_EXCMD
40424039 call self .compile_excmd (a: node )
4040+ return s: NIL
40434041 elseif a: node .type == s: NODE_FUNCTION
40444042 call self .compile_function (a: node )
4043+ return s: NIL
40454044 elseif a: node .type == s: NODE_DELFUNCTION
40464045 call self .compile_delfunction (a: node )
4046+ return s: NIL
40474047 elseif a: node .type == s: NODE_RETURN
40484048 call self .compile_return (a: node )
4049+ return s: NIL
40494050 elseif a: node .type == s: NODE_EXCALL
40504051 call self .compile_excall (a: node )
4052+ return s: NIL
40514053 elseif a: node .type == s: NODE_LET
40524054 call self .compile_let (a: node )
4055+ return s: NIL
40534056 elseif a: node .type == s: NODE_UNLET
40544057 call self .compile_unlet (a: node )
4058+ return s: NIL
40554059 elseif a: node .type == s: NODE_LOCKVAR
40564060 call self .compile_lockvar (a: node )
4061+ return s: NIL
40574062 elseif a: node .type == s: NODE_UNLOCKVAR
40584063 call self .compile_unlockvar (a: node )
4064+ return s: NIL
40594065 elseif a: node .type == s: NODE_IF
40604066 call self .compile_if (a: node )
4067+ return s: NIL
40614068 elseif a: node .type == s: NODE_WHILE
40624069 call self .compile_while (a: node )
4070+ return s: NIL
40634071 elseif a: node .type == s: NODE_FOR
40644072 call self .compile_for (a: node )
4073+ return s: NIL
40654074 elseif a: node .type == s: NODE_CONTINUE
40664075 call self .compile_continue (a: node )
4076+ return s: NIL
40674077 elseif a: node .type == s: NODE_BREAK
40684078 call self .compile_break (a: node )
4079+ return s: NIL
40694080 elseif a: node .type == s: NODE_TRY
40704081 call self .compile_try (a: node )
4082+ return s: NIL
40714083 elseif a: node .type == s: NODE_THROW
40724084 call self .compile_throw (a: node )
4085+ return s: NIL
40734086 elseif a: node .type == s: NODE_ECHO
40744087 call self .compile_echo (a: node )
4088+ return s: NIL
40754089 elseif a: node .type == s: NODE_ECHON
40764090 call self .compile_echon (a: node )
4091+ return s: NIL
40774092 elseif a: node .type == s: NODE_ECHOHL
40784093 call self .compile_echohl (a: node )
4094+ return s: NIL
40794095 elseif a: node .type == s: NODE_ECHOMSG
40804096 call self .compile_echomsg (a: node )
4097+ return s: NIL
40814098 elseif a: node .type == s: NODE_ECHOERR
40824099 call self .compile_echoerr (a: node )
4100+ return s: NIL
40834101 elseif a: node .type == s: NODE_EXECUTE
40844102 call self .compile_execute (a: node )
4103+ return s: NIL
40854104 elseif a: node .type == s: NODE_TERNARY
40864105 return self .compile_ternary (a: node )
40874106 elseif a: node .type == s: NODE_OR
0 commit comments