@@ -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
@@ -4039,50 +4034,73 @@ function! s:Compiler.compile(node)
40394034 return self .compile_toplevel (a: node )
40404035 elseif a: node .type == s: NODE_COMMENT
40414036 call self .compile_comment (a: node )
4037+ return s: NIL
40424038 elseif a: node .type == s: NODE_EXCMD
40434039 call self .compile_excmd (a: node )
4040+ return s: NIL
40444041 elseif a: node .type == s: NODE_FUNCTION
40454042 call self .compile_function (a: node )
4043+ return s: NIL
40464044 elseif a: node .type == s: NODE_DELFUNCTION
40474045 call self .compile_delfunction (a: node )
4046+ return s: NIL
40484047 elseif a: node .type == s: NODE_RETURN
40494048 call self .compile_return (a: node )
4049+ return s: NIL
40504050 elseif a: node .type == s: NODE_EXCALL
40514051 call self .compile_excall (a: node )
4052+ return s: NIL
40524053 elseif a: node .type == s: NODE_LET
40534054 call self .compile_let (a: node )
4055+ return s: NIL
40544056 elseif a: node .type == s: NODE_UNLET
40554057 call self .compile_unlet (a: node )
4058+ return s: NIL
40564059 elseif a: node .type == s: NODE_LOCKVAR
40574060 call self .compile_lockvar (a: node )
4061+ return s: NIL
40584062 elseif a: node .type == s: NODE_UNLOCKVAR
40594063 call self .compile_unlockvar (a: node )
4064+ return s: NIL
40604065 elseif a: node .type == s: NODE_IF
40614066 call self .compile_if (a: node )
4067+ return s: NIL
40624068 elseif a: node .type == s: NODE_WHILE
40634069 call self .compile_while (a: node )
4070+ return s: NIL
40644071 elseif a: node .type == s: NODE_FOR
40654072 call self .compile_for (a: node )
4073+ return s: NIL
40664074 elseif a: node .type == s: NODE_CONTINUE
40674075 call self .compile_continue (a: node )
4076+ return s: NIL
40684077 elseif a: node .type == s: NODE_BREAK
40694078 call self .compile_break (a: node )
4079+ return s: NIL
40704080 elseif a: node .type == s: NODE_TRY
40714081 call self .compile_try (a: node )
4082+ return s: NIL
40724083 elseif a: node .type == s: NODE_THROW
40734084 call self .compile_throw (a: node )
4085+ return s: NIL
40744086 elseif a: node .type == s: NODE_ECHO
40754087 call self .compile_echo (a: node )
4088+ return s: NIL
40764089 elseif a: node .type == s: NODE_ECHON
40774090 call self .compile_echon (a: node )
4091+ return s: NIL
40784092 elseif a: node .type == s: NODE_ECHOHL
40794093 call self .compile_echohl (a: node )
4094+ return s: NIL
40804095 elseif a: node .type == s: NODE_ECHOMSG
40814096 call self .compile_echomsg (a: node )
4097+ return s: NIL
40824098 elseif a: node .type == s: NODE_ECHOERR
40834099 call self .compile_echoerr (a: node )
4100+ return s: NIL
40844101 elseif a: node .type == s: NODE_EXECUTE
40854102 call self .compile_execute (a: node )
4103+ return s: NIL
40864104 elseif a: node .type == s: NODE_TERNARY
40874105 return self .compile_ternary (a: node )
40884106 elseif a: node .type == s: NODE_OR
0 commit comments