From 1d6e1bde40e3fa8f39cc4899835ba7f0b4940301 Mon Sep 17 00:00:00 2001 From: rdipardo <59004801+rdipardo@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:58:12 -0400 Subject: [PATCH] Update the Vim script functionList commentExpr ----------- * the UDL targets "legacy" Vim script, in which comments begin with a double quote ("), not a hash (#) as in Vim9 script [^1] mainExpr, nameExpr ------------------ * allow "namespaced" functions like those encountered in many Vim plugins. The conventional pattern is `#`, assuming `` can be found on the file system. Any sub-directories must also be part of the name, similar to a Java package, e.g., ### A namespaced function cannot be qualified with `s:` because the auto-generated script id of a "private" function makes the name differ from the name of the file or directory on disk * end the function name pattern with `\w*` instead of `\w+` to allow single-letter function names --- [^1] https://vimhelp.org/vim9.txt.html#vim9-differences --- .../unitTest.expected.result | 2 +- UDL-samples/Vimscript_by_rdipardo.vimrc | 34 +++++++++++++++++++ functionList/Vimscript_by_rdipardo.xml | 8 ++--- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result b/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result index 9fd2f85..c28ca41 100644 --- a/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result +++ b/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result @@ -1 +1 @@ -{"leaves":["build_go_files"],"root":"unitTest"} \ No newline at end of file +{"leaves":["build_go_files","F","Baz","g","H","foo","namespaced#function","Another#namespaced#function"],"root":"unitTest"} \ No newline at end of file diff --git a/UDL-samples/Vimscript_by_rdipardo.vimrc b/UDL-samples/Vimscript_by_rdipardo.vimrc index 11cc48a..b75f6b9 100644 --- a/UDL-samples/Vimscript_by_rdipardo.vimrc +++ b/UDL-samples/Vimscript_by_rdipardo.vimrc @@ -87,4 +87,38 @@ func! s:build_go_files() abort endif endfunc +""""""""""""""""""" +" Tests " +""""""""""""""""""" +function F(x) + echom 'Pass' +endfunction + +func Baz(x, y) + echom 'Pass' +endfunc + +function! s:g(x) + echom 'Pass' +endfunction + +function! s:H(x) + echom 'Pass' +endfunction + +func! s:foo(x, y) + echom 'Pass' +endfunc + +func! namespaced#function(...) + echom 'Pass' +endfunc + +func! Another#namespaced#function(...) + echom 'Pass' +endfunc + +" func IgnoreMe() +" endfunc + " vim: syntax=vim diff --git a/functionList/Vimscript_by_rdipardo.xml b/functionList/Vimscript_by_rdipardo.xml index 367c900..3b4adc3 100644 --- a/functionList/Vimscript_by_rdipardo.xml +++ b/functionList/Vimscript_by_rdipardo.xml @@ -13,15 +13,15 @@ - +