@@ -241,23 +241,25 @@ private void initialize() throws IOException {
241
241
// PowerShell
242
242
command .add ("--langdef=Posh" );
243
243
command .add ("--langmap=Posh:+.ps1,Posh:+.psm1" );
244
-
245
- if (env .isUniversalCtags ()) {
244
+ command .add ("--regex-Posh=/\\ $(\\ {[^}]+\\ })/\\ 1/v,variable/" );
245
+ command .add ("--regex-Posh=/\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1/v,variable/" );
246
+ command .add ("--regex-Posh=/^[[:space:]]*(:[^[:space:]]+)/\\ 1/l,label/" );
247
+
248
+ if (!env .isUniversalCtags ()) {
249
+ command .add ("--regex-Posh=/^[[:space:]]*([Ff]unction|[Ff]ilter)[[:space:]]+([^({[:space:]]+)[[:space:]]*(\\ (([^)]+)\\ ))?/\\ 2/f,function,functions/" );
250
+ } else {
246
251
command .add ("--_fielddef-Posh=signature,signatures" );
247
252
command .add ("--fields-Posh=+{signature}" );
248
- }
249
253
250
- // escaped variable markers
251
- command .add ("--regex-Posh=/`\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1//{exclusive}" );
252
- command .add ("--regex-Posh=/`\\ $(\\ {[^}]+\\ })/\\ 1//{exclusive}" );
253
- command .add ("--regex-Posh=/#.*\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1//{exclusive}" );
254
- command .add ("--regex-Posh=/#.*\\ $(\\ {[^}]+\\ })/\\ 1//{exclusive}" );
254
+ // escaped variable markers
255
+ command .add ("--regex-Posh=/`\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1//{exclusive}" );
256
+ command .add ("--regex-Posh=/`\\ $(\\ {[^}]+\\ })/\\ 1//{exclusive}" );
257
+ command .add ("--regex-Posh=/#.*\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1//{exclusive}" );
258
+ command .add ("--regex-Posh=/#.*\\ $(\\ {[^}]+\\ })/\\ 1//{exclusive}" );
259
+ command .add ("--regex-Posh=/^[[:space:]]*(function|filter)[[:space:]]+([^({[:space:]]+)[[:space:]]*(\\ (([^)]+)\\ ))?/\\ 2/f,function,functions/{icase}{exclusive}{_field=signature:(\\ 4)}" );
260
+
261
+ }
255
262
256
- command .add ("--regex-Posh=/\\ $(\\ {[^}]+\\ })/\\ 1/v,variable/" );
257
- command .add ("--regex-Posh=/\\ $([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\ 1/v,variable/" );
258
- command .add ("--regex-Posh=/^[[:space:]]*(function|filter)[[:space:]]+([^({[:space:]]+)[[:space:]]*(\\ (([^)]+)\\ ))?/\\ 2/f,function,functions/{icase}{exclusive}{_field=signature:(\\ 4)}" );
259
- command .add ("--regex-Posh=/^[[:space:]]*(:[^[:space:]]+)/\\ 1/l,label/" );
260
-
261
263
//PLEASE add new languages ONLY with POSIX syntax (see above wiki link)
262
264
263
265
/* Add extra command line options for ctags. */
0 commit comments