|
4 | 4 | function! s:get_parse_lines(lines) abort
|
5 | 5 | let from = index(a:lines, '} functions[] =')
|
6 | 6 | if from ==# -1
|
7 |
| - return [] |
| 7 | + throw 'cannot parse functions' |
8 | 8 | endif
|
9 | 9 | " find next '{'
|
10 | 10 | let from = index(a:lines, '{', from + 1)
|
@@ -59,14 +59,19 @@ endfunction
|
59 | 59 |
|
60 | 60 | " evalfunc_c: path to vim/src/evalfunc.c
|
61 | 61 | function! VimLParserNewFuncs(evalfunc_c) abort
|
62 |
| - let vimlparser = vimlparser#import() |
63 |
| - let latest = s:parse(a:evalfunc_c) |
64 |
| - let new_funcs = s:diff(vimlparser#import().VimLParser.builtin_functions, latest) |
65 |
| - let generated_text = s:gen_viml(new_funcs) |
66 |
| - if generated_text ==# '' |
67 |
| - verbose echo 's:VimLParser.builtin_functions in autoload/vimlparser.vim is up-to-date.' |
68 |
| - else |
69 |
| - verbose echo "Append following lines to s:VimLParser.builtin_functions in autoload/vimlparser.vim\n" |
70 |
| - verbose echo generated_text |
71 |
| - endif |
| 62 | + try |
| 63 | + let vimlparser = vimlparser#import() |
| 64 | + let latest = s:parse(a:evalfunc_c) |
| 65 | + let new_funcs = s:diff(vimlparser#import().VimLParser.builtin_functions, latest) |
| 66 | + let generated_text = s:gen_viml(new_funcs) |
| 67 | + if generated_text ==# '' |
| 68 | + verbose echo 's:VimLParser.builtin_functions in autoload/vimlparser.vim is up-to-date.' |
| 69 | + else |
| 70 | + verbose echo "Append following lines to s:VimLParser.builtin_functions in autoload/vimlparser.vim\n" |
| 71 | + verbose echo generated_text |
| 72 | + endif |
| 73 | + catch |
| 74 | + " :echoerr doesn't show output |
| 75 | + verbose echo '[ERROR]' v:exception 'at' v:throwpoint |
| 76 | + endtry |
72 | 77 | endfunction
|
0 commit comments