Skip to content

Commit cb24868

Browse files
committed
scriptish
1 parent 2f5c88d commit cb24868

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

js/jscompiler.vim

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ endfunction
842842
let s:viml_builtin_functions = ['abs', 'acos', 'add', 'and', 'append', 'append', 'argc', 'argidx', 'argv', 'argv', 'asin', 'atan', 'atan2', 'browse', 'browsedir', 'bufexists', 'buflisted', 'bufloaded', 'bufname', 'bufnr', 'bufwinnr', 'byte2line', 'byteidx', 'call', 'ceil', 'changenr', 'char2nr', 'cindent', 'clearmatches', 'col', 'complete', 'complete_add', 'complete_check', 'confirm', 'copy', 'cos', 'cosh', 'count', 'cscope_connection', 'cursor', 'cursor', 'deepcopy', 'delete', 'did_filetype', 'diff_filler', 'diff_hlID', 'empty', 'escape', 'eval', 'eventhandler', 'executable', 'exists', 'extend', 'exp', 'expand', 'feedkeys', 'filereadable', 'filewritable', 'filter', 'finddir', 'findfile', 'float2nr', 'floor', 'fmod', 'fnameescape', 'fnamemodify', 'foldclosed', 'foldclosedend', 'foldlevel', 'foldtext', 'foldtextresult', 'foreground', 'function', 'garbagecollect', 'get', 'get', 'getbufline', 'getbufvar', 'getchar', 'getcharmod', 'getcmdline', 'getcmdpos', 'getcmdtype', 'getcwd', 'getfperm', 'getfsize', 'getfontname', 'getftime', 'getftype', 'getline', 'getline', 'getloclist', 'getmatches', 'getpid', 'getpos', 'getqflist', 'getreg', 'getregtype', 'gettabvar', 'gettabwinvar', 'getwinposx', 'getwinposy', 'getwinvar', 'glob', 'globpath', 'has', 'has_key', 'haslocaldir', 'hasmapto', 'histadd', 'histdel', 'histget', 'histnr', 'hlexists', 'hlID', 'hostname', 'iconv', 'indent', 'index', 'input', 'inputdialog', 'inputlist', 'inputrestore', 'inputsave', 'inputsecret', 'insert', 'invert', 'isdirectory', 'islocked', 'items', 'join', 'keys', 'len', 'libcall', 'libcallnr', 'line', 'line2byte', 'lispindent', 'localtime', 'log', 'log10', 'luaeval', 'map', 'maparg', 'mapcheck', 'match', 'matchadd', 'matcharg', 'matchdelete', 'matchend', 'matchlist', 'matchstr', 'max', 'min', 'mkdir', 'mode', 'mzeval', 'nextnonblank', 'nr2char', 'or', 'pathshorten', 'pow', 'prevnonblank', 'printf', 'pumvisible', 'pyeval', 'py3eval', 'range', 'readfile', 'reltime', 'reltimestr', 'remote_expr', 'remote_foreground', 'remote_peek', 'remote_read', 'remote_send', 'remove', 'remove', 'rename', 'repeat', 'resolve', 'reverse', 'round', 'screencol', 'screenrow', 'search', 'searchdecl', 'searchpair', 'searchpairpos', 'searchpos', 'server2client', 'serverlist', 'setbufvar', 'setcmdpos', 'setline', 'setloclist', 'setmatches', 'setpos', 'setqflist', 'setreg', 'settabvar', 'settabwinvar', 'setwinvar', 'sha256', 'shellescape', 'shiftwidth', 'simplify', 'sin', 'sinh', 'sort', 'soundfold', 'spellbadword', 'spellsuggest', 'split', 'sqrt', 'str2float', 'str2nr', 'strchars', 'strdisplaywidth', 'strftime', 'stridx', 'string', 'strlen', 'strpart', 'strridx', 'strtrans', 'strwidth', 'submatch', 'substitute', 'synID', 'synIDattr', 'synIDtrans', 'synconcealed', 'synstack', 'system', 'tabpagebuflist', 'tabpagenr', 'tabpagewinnr', 'taglist', 'tagfiles', 'tempname', 'tan', 'tanh', 'tolower', 'toupper', 'tr', 'trunc', 'type', 'undofile', 'undotree', 'values', 'virtcol', 'visualmode', 'wildmenumode', 'winbufnr', 'wincol', 'winheight', 'winline', 'winnr', 'winrestcmd', 'winrestview', 'winsaveview', 'winwidth', 'writefile', 'xor']
843843

844844
let s:script_dir = expand('<sfile>:h')
845-
function! s:convert(in, out)
845+
function! s:convert(in, out) abort
846846
let vimlfunc = fnamemodify(s:script_dir . '/vimlfunc.js', ':p')
847847
let head = readfile(vimlfunc)
848848
try
@@ -865,7 +865,7 @@ function! s:convert(in, out)
865865
\ ]
866866
call writefile(head + lines + tail, a:out)
867867
catch
868-
echoerr substitute(v:throwpoint, '\.\.\zs\d\+', '\=s:numtoname(submatch(0))', 'g') . "\n" . v:exception
868+
throw substitute(v:throwpoint, '\.\.\zs\d\+', '\=s:numtoname(submatch(0))', 'g') . "\n" . v:exception
869869
endtry
870870
endfunction
871871

@@ -900,8 +900,13 @@ function! s:parse_args() abort
900900
endfunction:
901901

902902
function! s:main() abort
903-
let args = s:parse_args()
904-
call s:convert(args[0], args[1])
903+
try
904+
let args = s:parse_args()
905+
call s:convert(args[0], args[1])
906+
catch
907+
call writefile([v:exception], has('win32') ? 'conout$' : '/dev/stderr')
908+
cquit
909+
endtry
905910
endfunction
906911

907912
call s:main()

py/pycompiler.vim

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,13 @@ function! s:parse_args() abort
872872
endfunction:
873873

874874
function! s:main() abort
875-
let args = s:parse_args()
876-
call s:convert(args[0], args[1])
875+
try
876+
let args = s:parse_args()
877+
call s:convert(args[0], args[1])
878+
catch
879+
call writefile([v:exception], has('win32') ? 'conout$' : '/dev/stderr')
880+
cquit
881+
endtry
877882
endfunction
878883

879884
call s:main()

scripts/pycompile.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
@echo off
22
vim -E -s -N --cmd "set rtp+=." -c "exe 'so' argv()[0]" -c q -- py/pycompiler.vim %*
3-

scripts/pycompile.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/sh
22
vim -E -s -N --cmd 'set rtp+=.' -c 'exe "so" argv()[0]' -c q -- py/pycompiler.vim $*
3-

0 commit comments

Comments
 (0)