Skip to content

Instantly share code, notes, and snippets.

@terminatorul
Last active June 12, 2024 18:41
Show Gist options
  • Save terminatorul/b563855cd6af9a1ed41f36743fe0e9d2 to your computer and use it in GitHub Desktop.
Save terminatorul/b563855cd6af9a1ed41f36743fe0e9d2 to your computer and use it in GitHub Desktop.
Update the default Vim script parser in ctags to support Vim9 script
# Copyright(C) 2024 Timothy Madden <terminatorul@gmail.com>
#
# Provided under the MIT No Attribution License: https://opensource.org/license/MIT-0
# This ctags configuration file builds on top of the default Vim script parser in ctags, and adds support for Vim9 script.
#
# Line continuation with backslashes not implemented, except for the function argument list
# List destructuring like [ g:rangeMin, g:rangeMax ] = getIntervalRange() also implemented
# Statements concatenated on a single line, using the pipe <Bar> character as a delimiter, are recognized as such
#
# Save this file under ~/.ctags.c/, and parse a Vim file to see the results.
#
--kinddef-vim=g,vim9global,global variables
--kinddef-vim=K,vim9const,constants
--kinddef-vim=L,class,class
--kinddef-vim=l,local,local variables
--kinddef-vim=D,funcdef,functions
--kinddef-vim=d,nested,local functions
--kinddef-vim=M,method,methods
--kinddef-vim=I,interface,interfaces
--kinddef-vim=E,enum,enumerations
--kinddef-vim=e,enumerator,enumerators
--kinddef-vim=T,type,type definition
--kinddef-vim=V,field,fields
--kinddef-vim=i,import,module import
--kinds-vim=-{local}{function}{variable}{constant}
--kinds-vim=+{vim9global}{vim9const}{class}{funcdef}{method}{interface}{enum}{enumerator}{type}{field}{import}
--_fielddef-vim=access,memeber visibility
--_fielddef-vim=file,file-restricted scoping
--_fielddef-vim=signature,function signature
--_fielddef-vim=properties,exported proprty
--fields-vim=+{access}{file}{signature}{properties}
--_tabledef-vim=toplevel
--_tabledef-vim=legacyfunction
--_tabledef-vim=vim9script
--_tabledef-vim=classbody
--_tabledef-vim=functionbody
--_tabledef-vim=interfacebody
--_tabledef-vim=enumbody
# function local variables and constants, nested functions
--_mtable-regex-vim=functionbody/[[:space:]:]*enddef\s*(\n|\||$)///{scope=pop}{tleave}
--_mtable-regex-vim=functionbody/[[:space:]:]*def[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)|]+|\([^)|]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=functionbody/[[:space:]:]*def[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)|]+|\([^)|]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/d,nested/{tenter=functionbody}{scope=ref}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=functionbody/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:space:]]+[[:alnum:]]+)*)\s*(\n|\||$)/\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
--_mtable-regex-vim=functionbody/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:space:]]+[[:alnum:]]+)*)\s*(\n|\||$)/g:\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
--_mtable-regex-vim=functionbody/[[:space:]:]*(var|const|final)\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/l,local/{scope=ref}
--_mtable-regex-vim=functionbody/[[:space:]:]*(const|final)\s+([gtwb]:\w+)([^\n|]*|\|\|)\s*(\n|\||$)/\2/K,vim9const/
--_mtable-regex-vim=functionbody/[[:space:]:]*((([gtwb]:)|&([lg]:)?|\$)\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\1/g,vim9global/
--_mtable-regex-vim=functionbody/[[:space:]:]*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=functionbody/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# legacy function local variables, constants, nested functions
--_mtable-regex-vim=legacyfunction/[[:space:]:]*end(f(u(n(c(t(ion)?)?)?)?)?|function)?\s*(\n|\||$)///{scope=pop}{tleave}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*def[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*def[[:blank:]]*!?\s+(s:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}{_field=file:}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*def[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/g:\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+[[:alnum:]]+)*)\s*(\n|\||$)/\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+(s:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+[[:alnum:]]+)*)\s*(\n|\||$)/\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}{_field=file:}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+[[:alnum:]]+)*)\s*(\n|\||$)/g:\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(const|final)\s+([gtwb]:\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/K,vim9const/
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(const|final)\s+(s:\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/K,vim9const/{_field=file:}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(let|vim9cmd)\s+([gtwb]:\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/g,vim9global/
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(let|vim9cmd)\s+((&([gl]:)?|\$)\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/g,vim9global/
--_mtable-regex-vim=legacyfunction/[[:space:]:]*let\s+(s:\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\1/g,vim9global/{_field=file:}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(let|const|final)\s+(\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/l:\2/l,local/{scope=ref}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*(let|const|final)\s+(l:\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/l,local/{scope=ref}
--_mtable-regex-vim=legacyfunction/[[:space:]:]*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=legacyfunction/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# methods and fields: private, readonly and public
--_mtable-regex-vim=classbody/[[:space:]:]*endclass\s*(\n|\||$)///{scope=pop}{tleave}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?var\s+(_\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/V,field/{scope=ref}{_field=access:private}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/V,field/{scope=ref}{_field=access:protected}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?public\s+(static\s+)?var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\3/V,field/{scope=ref}{_field=access:public}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?(final|const)\s+(_\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\3/K,vim9const/{scope=ref}{_field=access:private}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?(final|const)\s+([^_]\w*)([^\n|]|\|\|)*\s*(\n|\||$)/\3/K,vim9const/{scope=ref}{_field=access:protected}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?public\s+(static\s+)?(final|const)\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\4/K,vim9const/{scope=ref}{_field=access:public}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?def[[:blank:]]*!?\s+(_[^(\n|]+)(\(([^\)]+|\([^\)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\2/M,method/{tenter=functionbody}{scope=push}{_field=access:private}{_field=signature:\3}
--_mtable-regex-vim=classbody/[[:space:]:]*(static\s+)?def[[:blank:]]*!?\s+([^_][^(\n|]*)(\(([^\)]+|\([^\)]*\))*\)(\s*:\s+[^\n|]+)?)*\s*(\n|\||$)/\2/M,method/{tenter=functionbody}{scope=push}{_field=access:public}{_field=signature:\3}
--_mtable-regex-vim=classbody/[[:space:]:]*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=classbody/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# interface methods and fields
--_mtable-regex-vim=interfacebody/[[:space:]:]*endinterface\s*(\n|\||$)///{scope=pop}{tleave}
--_mtable-regex-vim=interfacebody/[[:space:]:]*var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/V,field/{scope=ref}{_field=access:public}
--_mtable-regex-vim=interfacebody/[[:space:]:]*def[[:blank:]]*!?\s+([^(\n|]+)(\(([^\)]+|\([^\)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/M,method/{scope=ref}{_field=access:public}{_field=signature:\2}
--_mtable-regex-vim=interfacebody/[[:space:]:]*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=interfacebody/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# enumerators, enum methods and fields
--_mtable-regex-vim=enumbody/[[:space:]:]*endenum\s*(\n|\||$)///{scope=pop}{tleave}
--_mtable-regex-vim=enumbody/[[:space:]:]*var\s+(_\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/V,field/{scope=ref}{_field=access:private}
--_mtable-regex-vim=enumbody/[[:space:]:]*var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/V,field/{scope=ref}{_field=access:protected}
--_mtable-regex-vim=enumbody/[[:space:]:]*public\s+var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/V,field/{scope=ref}{_field=access:public}
--_mtable-regex-vim=enumbody/[[:space:]:]*(final|const)\s+(_\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/K,vim9const/{scope=ref}{_field=access:private}
--_mtable-regex-vim=enumbody/[[:space:]:]*(final|const)\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/K,vim9const/{scope=ref}{_field=access:protected}
--_mtable-regex-vim=enumbody/[[:space:]:]*public\s+(final|const)\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/V,field/{scope=ref}{_field=access:public}
--_mtable-regex-vim=enumbody/[[:space:]:]*(static\s+)?def[[:blank:]]*!?\s+(_[^(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\2/M,method/{tenter=functionbody}{scope=push}{_field=access:private}{_field=signature:\3}
--_mtable-regex-vim=enumbody/[[:space:]:]*(static\s+)?def[[:blank:]]*!?\s+([^_][^(\n|]*)(\(([^\)]+|\([^\)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\2/M,method/{tenter=functionbody}{scope=push}{_field=access:public}{_field=signature:\3}
--_mtable-regex-vim=enumbody/[[:space:]:]*(\w+)(\([^)]*\))?,?\s*(\n|\||$)/\1/e,enumerator/{scope=ref}{_field=access:public}
--_mtable-regex-vim=enumbody/\s*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=enumbody/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# variable and global variable
--_mtable-regex-vim=vim9script/[[:space:]:]*export\s+var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/g,vim9global/{_field=properties:export}
--_mtable-regex-vim=vim9script/[[:space:]:]*([gtwb]:\w+)\s*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\1/g,vim9global/
--_mtable-regex-vim=vim9script/[[:space:]:]*var\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\1/g,vim9global/{_field=file:}
# const / final
--_mtable-regex-vim=vim9script/[[:space:]:]*export\s+(const|final)\s+(\w+)([^\n|]|\|\|)*(\n|\||$)/\2/K,vim9const/{_field=properties:export}
--_mtable-regex-vim=vim9script/[[:space:]:]*(const|final)\s+([gwbt]:\w+)([^\n|]|\|\|)*(\n|\||$)/\2/K,vim9const/
--_mtable-regex-vim=vim9script/[[:space:]:]*(const|final)\s+(\w+)([^\n|]|\|\|)*(\n|\||$)/\2/K,vim9const/{_field=file:}
# type definition
--_mtable-regex-vim=vim9script/[[:space:]:]*export\s+type\s+(\w+)\s*=\s*(([^\n|]|\|\|)*)\s*(\n|\||$)/\1/T,type/{_field=properties:export}{_field=signature: = \2}
--_mtable-regex-vim=vim9script/[[:space:]:]*type\s+(\w+)\s*=\s*(([^\n|]|\|\|)*)\s*(\n|\||$)/\1/T,type/{_field=file:}{_field=signature: = \2}
# import statement
--_mtable-regex-vim=vim9script/[[:space:]:]*import\s+(autoload\s+)?([^\n|]|\|\|)+\s+as\s+(\w+)[^\n|]*\s*(\n|\||$)/\3/i,import/{_field=file:}
--_mtable-regex-vim=vim9script/[[:space:]:]*import\s+(autoload\s+)?"([^\n"]|\\")*\<(\w+)\.vim"[^\n|]*(\n|\||$)/\3/i,import/{_field=file:}
--_mtable-regex-vim=vim9script/[[:space:]:]*import\s+(autoload\s+)?'([^\n']|'')*\<(\w+)\.vim'[^\n|]*(\n|\||$)/\3/i,import/{_field=file:}
# function
--_mtable-regex-vim=vim9script/[[:space:]:]*export\s+def[[:blank:]]*!?\s+((g:)?\w+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+([^\n|]|\|\|)+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\3}
--_mtable-regex-vim=vim9script/[[:space:]:]*def[[:blank:]]*!?\s+(g:\w+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+([^\n|]|\|\|)+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=vim9script/[[:space:]:]*def[[:blank:]]*!?\s+(\w+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+([^\n|]|\|\|)+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=file:}{_field=signature:\2}
# class, interface
--_mtable-regex-vim=vim9script/\s*export\s+(abstract\s+)?class\s+(\w+)[^\n]*\s*(\n|\||$)/\2/L,class/{tenter=classbody}{scope=push}
--_mtable-regex-vim=vim9script/\s*(abstract\s+)?class\s+(\w+)[^\n]*\s*(\n|\||$)/\2/L,class/{tenter=classbody}{scope=push}{_field=file:}
--_mtable-regex-vim=vim9script/\s*export\s+interface\s+(\w+)[^\n]*\s*(\n|\||$)/\1/I,interface/{tenter=interfacebody}{scope=push}
--_mtable-regex-vim=vim9script/\s*interface\s+(\w+)[^\n]*\s*(\n|\||$)/\1/I,interface/{tenter=interfacebody}{scope=push}{_field=file:}
# enum
--_mtable-regex-vim=vim9script/\s*export\s+enum\s+(\w+)[^\n]*\s*(\n|\||$)/\1/E,enum/{tenter=enumbody}{scope=push}
--_mtable-regex-vim=vim9script/\s*enum\s+(\w+)[^\n]*\s*(\n|\||$)/\1/E,enum/{tenter=enumbody}{scope=push}{_field=file:}
--_mtable-regex-vim=vim9script/\s*#([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=vim9script/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
# legacy variable, const, final
--_mtable-regex-vim=toplevel/[[:space:]:]*(let|vim9cmd)\s+([gtwb]:\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/g,vim9global/
--_mtable-regex-vim=toplevel/[[:space:]:]*(let|vim9cmd)\s+((&([gl]:)?|\$)\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/g,vim9global/
--_mtable-regex-vim=toplevel/[[:space:]:]*(let)\s+(s:\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/\2/g,vim9global/{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*(let)\s+(\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/g:\2/g,vim9global/
--_mtable-regex-vim=toplevel/[[:space:]:]*(vim9cmd\s+var)\s+(\w+)[[:space:]]*[[:punct:]]*=([^\n|]|\|\|)*\s*(\n|\||$)/s:\2/g,vim9global/
--_mtable-regex-vim=toplevel/[[:space:]:]*(vim9cmd\s+)?(const|final)\s+([gtwb]:\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\4/K,vim9const/
--_mtable-regex-vim=toplevel/[[:space:]:]*(const|final)\s+(s:\w+)([^\n|]|\|\|)*\s*(\n|\||$)/\2/K,vim9const/{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*(const|final)\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/g:\2/K,vim9const/
--_mtable-regex-vim=toplevel/[[:space:]:]*(vim9cmd\s+(const|final))\s+(\w+)([^\n|]|\|\|)*\s*(\n|\||$)/s:\3/K,vim9const/
# legacy import statements
--_mtable-regex-vim=toplevel/[[:space:]:]*import\s+(autoload\s+)?([^\n|]|\|\|)+\s+as\s+(s:)?(\w+)[^\n]*\s*(\n|\||$)/s:\4/i,import/{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*import\s+(autoload\s+)?([^\n|]|\|\|)+\s+as\s+(s:)?(\w+)[^\n]*\s*(\n|\||$)/s:\3/i,import/{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*import\s+(autoload\s+)?"([^\n"]|\\")*\<(\w+)\.vim"[^\n]*(\n|\||$)/s:\3/i,import/{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*import\s+(autoload\s+)?'([^\n']|'')*\<(\w+)\.vim'[^\n|]*(\n|\||$)/s:\3/i,import/{_field=file:}
# legacy function
--_mtable-regex-vim=toplevel/[[:space:]:]*def[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=toplevel/[[:space:]:]*def[[:blank:]]*!?\s+(s:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*def[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)]+|\([^)]*\))*\)(\s*:\s+[^\n|]+)?)\s*(\n|\||$)/g:\1/D,funcdef/{tenter=functionbody}{scope=push}{_field=signature:\2}
--_mtable-regex-vim=toplevel/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+(g:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+\w+)*)\s*(\n|\|$)/\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
--_mtable-regex-vim=toplevel/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+(s:[^(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+\w+)*)\s*(\n|\|$)/\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}{_field=file:}
--_mtable-regex-vim=toplevel/[[:space:]:]*fu(n(c(t(ion)?)?)?)?[[:blank:]]*!?\s+([^:(\n|]+)(\(([^)]+|\([^)]*\))*\)([[:blank:]]+\w+)*)\s*(\n|\|$)/g:\5/D,funcdef/{tenter=legacyfunction}{scope=push}{_field=signature:\6}
# legacy script
--_mtable-regex-vim=toplevel/[[:space:]:]*vim9script\s*(\n|\|$)///{tenter=vim9script}
--_mtable-regex-vim=toplevel/\s*"([^\n]|\n[[:blank:]]*\\)*(\n|$)///
--_mtable-regex-vim=toplevel/([^\n|]|\|\||\n[[:blank:]]*\\)*(\n|\||$)///
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment