v / .ctags.d /
1## TODO: support more precise struct/const/enum fields
2
3--langdef=V
4--map-V=+.v
5--map-V=+.vv
6--map-V=+.vsh
7--kinddef-V=m,imodule,imported modules
8--kinddef-V=M,module,modules
9--kinddef-V=C,cfunction,cfunctions
10--kinddef-V=f,function,functions
11--kinddef-V=h,method,functions
12--kinddef-V=c,const,constants
13--kinddef-V=v,variable,variables
14--kinddef-V=s,struct,structs
15--kinddef-V=e,enum,enums
16--kinddef-V=i,interface,interfaces
17--kinddef-V=S,sfield,struct field
18--kinddef-V=E,efield,enum field
19--_roledef-V.m=imported,imported module
20--_roledef-V.M=declared,module declaration
21--regex-V=/^module[[:blank:]]+([0-9a-zA-Z]+)[[:blank:]]*$/\1/M/{_role=declared}{scope=push}
22--regex-V=/^import[[:blank:]]+(([0-9a-zA-Z]+)?|.*\.([a-zA-Z_][0-9a-zA-Z]+))[[:blank:]]*$/\2\3/m/{_role=imported}{scope=ref}
23--regex-V=/^[[:blank:]]*fn[[:blank:]]+C\.([a-zA-Z_][0-9a-zA-Z_]*)\(/C.\1/C/
24--regex-V=/^(pub)?[[:blank:]]*fn[[:blank:]]+([a-zA-Z_][0-9a-zA-Z_]*)\(/\2/f/
25--regex-V=/^(pub)?[[:blank:]]*fn[[:blank:]]+\(.*\)[[:blank:]]*([a-zA-Z_][0-9a-zA-Z_]*)\(/\2/h/
26--regex-V=/^(pub)?[[:blank:]]*struct[[:blank:]]+([a-zA-Z_][0-9a-zA-Z_]*)[[:blank:]]*\{/\2/s/{scope=push}
27--regex-V=/^(pub)?[[:blank:]]*enum[[:blank:]]+([a-zA-Z_][0-9a-zA-Z_]*)[[:blank:]]*\{/\2/e/{scope=push}
28--regex-V=/^(pub)?[[:blank:]]*interface[[:blank:]]+([a-zA-Z_][0-9a-zA-Z_]*)[[:blank:]]*\{/\2/i/{scope=push}
29--regex-V=/^[[:blank:]]*([a-zA-Z_][0-9a-zA-Z_]+)[[:blank:]]*(,)?[[:blank:]]*(\/\/.*)?$/\1/E/{scope=ref}
30--regex-V=/^[[:blank:]]*([a-zA-Z_][0-9a-zA-Z_]+)[[:blank:]]+\??\&?(\[[0-9]*\])?([a-zA-Z_][0-9a-zA-Z_.]+)[[:blank:]]*(\/\/.*)?$/\1/S/{scope=ref}
31--regex-V=/^[[:blank:]]*\}[[:blank:]]*$//{scope=pop}{placeholder}
32
33## Variables:
34--regex-V=/^[[:blank:]]*(mut[[:blank:]]+)?([a-zA-Z_][0-9a-zA-Z_]+)[[:blank:]]*:=/\2/v/
35
36## Consts:
37--regex-V=/^(pub)?[[:blank:]]*const[[:blank:]]+\([[:blank:]]*/const/c/{scope=push}
38##NB: the next variable regexp should work only inside const ( ), but currently works for ordinary assignments too:
39--regex-V=/^[[:blank:]]*([a-zA-Z_][0-9a-zA-Z_]+)[[:blank:]]*=/\1/v/{scope=ref}
40--regex-V=/^[[:blank:]]*\)[[:blank:]]*$//{scope=pop}{placeholder}
41
42--extras=+q
43--extras=+r
44--fields=+r