4
4
"
5
5
" License: This file is placed in the public domain.
6
6
7
+ " s:import is only public API and you can access this script-local function via
8
+ " vital.vim. See https://github.com/vim-jp/vital.vim for more detail.
9
+ "
10
+ " Historically, vimlparser.vim is not vital module and there are other exported
11
+ " functions as vital-module, but they are not expected to be used.
12
+ " The one reason we didn't make them as private function (add `_` prefix to
13
+ " script local function) is that this file will be translated into other
14
+ " languages like Python and JavaScript. Also, vimlparser developers have no
15
+ " need to learn vital.vim convention and develop vimlparser same as before as
16
+ " much as possible.
17
+ "
18
+ " Example:
19
+ " call extend(s:, vital#vital#import('VimLParser').import())
20
+ "
21
+ " function! s:run() abort
22
+ " let code = [
23
+ " \ 'let s:message = printf("hello %d", 1+(2*3))'
24
+ " \ ]
25
+ " let r = s:StringReader.new(code)
26
+ " let p = s:VimLParser.new()
27
+ " let c = s:Compiler.new()
28
+ " echo join(c.compile(p.parse(r)), "\n")
29
+ " endfunction
30
+ "
31
+ " call s:run()
7
32
function ! s: import () abort
8
33
return s:
9
34
endfunction
@@ -906,7 +931,7 @@ function! s:VimLParser.find_command()
906
931
endif
907
932
endfor
908
933
909
- if self .neovim
934
+ if self .neovim
910
935
for x in self .neovim_additional_commands
911
936
if stridx (x .name, name) == 0 && len (name) >= x .minlen
912
937
unlet cmd
@@ -923,7 +948,7 @@ function! s:VimLParser.find_command()
923
948
endif
924
949
endfor
925
950
endif
926
-
951
+
927
952
" FIXME: user defined command
928
953
if (cmd is s: NIL || cmd.name == # ' Print' ) && name = ~# ' ^[A-Z]'
929
954
let name .= self .reader.read_alnum ()
0 commit comments