Skip to content

Commit

Permalink
Units: use GNU extension regex patterns
Browse files Browse the repository at this point in the history
Some changes are not equivalent with orignal to try more use of extensions.
  • Loading branch information
hirooih committed May 22, 2021
1 parent dd177c3 commit fc71cc9
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Units/regex-flag-anonymous-gnu.d/args.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
--kinddef-foo=m,module,modules
--kinddef-foo=x,exception,exceptions

--regex-foo=/^defmodule *([a-zA-Z0-9]+) *do/\1/m/{scope=push}
--regex-foo=/^defmodule\s*(\w+)\s*do/\1/m/{scope=push}
--regex-foo=/^end//{scope=pop}{placeholder}
--regex-foo=/ +defexception( +.*)$//x/{_anonymous=exception}{scope=ref}
--regex-foo=/\s+defexception(\s+.*)$//x/{_anonymous=exception}{scope=ref}
4 changes: 2 additions & 2 deletions Units/regex-flag-anonymous-gnu.d/expected.tags
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MyAppError1 input.foo /^defmodule MyAppError1 do$/;" m
exceptionf9e1959f0101 input.foo /^ defexception [:message]$/;" x module:MyAppError1
exception4808aff60101 input.foo /^ defexception [:message]$/;" x module:MyAppError1
MyAppError2 input.foo /^defmodule MyAppError2 do$/;" m
exceptionf9e1959f0201 input.foo /^ defexception [:message]$/;" x module:MyAppError2
exception4808aff60201 input.foo /^ defexception [:message]$/;" x module:MyAppError2
2 changes: 1 addition & 1 deletion Units/regex-multiline-flag-dos-gnu.d/args.ctags
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Taken from #1473 opened by WillDHB
--langdef=mltest
--mline-regex-mltest=/@subscribe([[:space:]])*([a-z ]+)[[:space:]]*([a-zA-Z]*)\(([a-zA-Z]*)/\3-\4/s,subscription/{mgroup=3}
--mline-regex-mltest=/@subscribe\s*[a-z ]+\s*([a-zA-Z]*)\(([a-zA-Z]*)/\1-\2/s,subscription/{mgroup=1}
--excmd=mixed
--fields=+ln
--language-force=mltest
2 changes: 1 addition & 1 deletion Units/regex-multiline-flag-gnu.d/args.ctags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--langdef=javaspring
--langmap=javaspring:.java
--mline-regex-javaspring=/@Subscribe([[:space:]])*([a-z ]+)[[:space:]]*([a-zA-Z]*)\(([a-zA-Z]*)/\3-\4/s,subscription/{mgroup=3}
--mline-regex-javaspring=/@Subscribe\s*[a-z ]+\s*([a-zA-Z]*)\(([a-zA-Z]*)/\1-\2/s,subscription/{mgroup=1}
--excmd=mixed
--fields=+ln
4 changes: 2 additions & 2 deletions Units/regex-multiline-flag-hat-and-doller-gnu.d/args.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--langmap=FOOBAR:.foobar
--kinddef-FOOBAR=d,def,definitions
--kinddef-FOOBAR=D,Def,Definitions
--mline-regex-foobar=/^def[\n\t ]+([a-z]+)$/\1/d/{mgroup=1}
--mline-regex-foobar=/[\n]?def[\n\t ]+([a-z]+)\n/\1/D/{mgroup=1}
--mline-regex-foobar=/^def\s+([a-z]+)$/\1/d/{mgroup=1}
--mline-regex-foobar=/[\n]?def\s+([a-z]+)\n/\1/D/{mgroup=1}
--fields=+ln
2 changes: 1 addition & 1 deletion Units/regex-multiline-flag-newline-gnu.d/args.ctags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--langdef=FOOBAR
--langmap=FOOBAR:.foobar
--kinddef-FOOBAR=d,def,definitions
--mline-regex-foobar=/^def((\n[\n\t])|(: ))([a-z0-9-]+)/\4/d/{mgroup=4}
--mline-regex-foobar=/^def(\n[\n\t]|: )(\w+)/\2/d/{mgroup=2}
--fields=+ln
16 changes: 8 additions & 8 deletions Units/regex-with-scope-autoFQTag-gnu.d/args.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
--langdef=foo{_autoFQTag}
--map-foo=+.foo
--regex-foo=/^#.*//{exclusive}
--regex-foo=/^[[:blank:]]*define[[:blank:]]+([[:alnum:]_]+)[[:blank:]]*\{/\1/d,definition/{scope=push}
--regex-foo=/^[[:blank:]]*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^[[:blank:]]*package[[:blank:]]+([[:alnum:]_]+)/\1/p,package/{scope=push}
--regex-foo=/^[[:blank:]]*end[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*\}[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*ns[[:blank:]]+([[:alnum:]_]+)/\1/n,namespace/{scope=set}
--regex-foo=/^[[:blank:]]*var[[:blank:]]+([[:alnum:]_]+)/\1/v,var/{scope=ref}
--regex-foo=/^[[:blank:]]*global//{scope=clear}{exclusive}
--regex-foo=/^\s*define\s+(\w+)\s*\{/\1/d,definition/{scope=push}
--regex-foo=/^\s*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^\s*package\s+(\w+)/\1/p,package/{scope=push}
--regex-foo=/^\s*end\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*\}\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*ns\s+(\w+)/\1/n,namespace/{scope=set}
--regex-foo=/^\s*var\s+(\w+)/\1/v,var/{scope=ref}
--regex-foo=/^\s*global//{scope=clear}{exclusive}
16 changes: 8 additions & 8 deletions Units/regex-with-scope-gnu.d/args.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
--langdef=foo
--map-foo=+.foo
--regex-foo=/^#.*//{exclusive}
--regex-foo=/^[[:blank:]]*define[[:blank:]]+([[:alnum:]_]+)[[:blank:]]*\{/\1/d,definition/{scope=push}
--regex-foo=/^[[:blank:]]*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^[[:blank:]]*package[[:blank:]]+([[:alnum:]_]+)/\1/p,package/{scope=push}
--regex-foo=/^[[:blank:]]*end[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*\}[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*ns[[:blank:]]+([[:alnum:]_]+)/\1/n,namespace/{scope=set}
--regex-foo=/^[[:blank:]]*var[[:blank:]]+([[:alnum:]_]+)/\1/v,var/{scope=ref}
--regex-foo=/^[[:blank:]]*global//{scope=clear}{exclusive}
--regex-foo=/^\s*define\s+(\w+)\s*\{/\1/d,definition/{scope=push}
--regex-foo=/^\s*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^\s*package\s+(\w+)/\1/p,package/{scope=push}
--regex-foo=/^\s*end\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*\}\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*ns\s+(\w+)/\1/n,namespace/{scope=set}
--regex-foo=/^\s*var\s+(\w+)/\1/v,var/{scope=ref}
--regex-foo=/^\s*global//{scope=clear}{exclusive}
20 changes: 10 additions & 10 deletions Units/regex-with-scope-nested-gnu.d/args.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
--langdef=foo
--map-foo=+.foo
--regex-foo=/^#.*//{exclusive}
--regex-foo=/^[[:blank:]]*define[[:blank:]]+([[:alnum:]_]+)[[:blank:]]*\{/\1/d,definition/{scope=push}
--regex-foo=/^[[:blank:]]*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^[[:blank:]]*package[[:blank:]]+([[:alnum:]_]+)/\1/p,package/{scope=push}
--regex-foo=/^[[:blank:]]*end[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*\}[[:blank:]]*$//{scope=pop}{exclusive}
--regex-foo=/^[[:blank:]]*ns[[:blank:]]+([[:alnum:]_]+)/\1/n,namespace/{scope=set}
--regex-foo=/^[[:blank:]]*var[[:blank:]]+([[:alnum:]_]+)/\1/v,var/{scope=ref}
--regex-foo=/^[[:blank:]]*global//{scope=clear}{exclusive}
--regex-foo=/^\s*define\s+(\w+)\s*\{/\1/d,definition/{scope=push}
--regex-foo=/^\s*\{/_/d,definition/{scope=push}{placeholder}
--regex-foo=/^\s*package\s+(\w+)/\1/p,package/{scope=push}
--regex-foo=/^\s*end\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*\}\s*$//{scope=pop}{exclusive}
--regex-foo=/^\s*ns\s+(\w+)/\1/n,namespace/{scope=set}
--regex-foo=/^\s*var\s+(\w+)/\1/v,var/{scope=ref}
--regex-foo=/^\s*global//{scope=clear}{exclusive}

--langdef=bar{base=foo}
--kinddef-bar=s,scope,scopes
--kinddef-bar=d,definition,definitions
--regex-bar=/^# open:([[:alnum:]_]+)/\1/s/{scope=push}
--regex-bar=/^# def:([[:alnum:]_]+)/\1/d/{scope=ref}
--regex-bar=/^# open:(\w+)/\1/s/{scope=push}
--regex-bar=/^# def:(\w+)/\1/d/{scope=ref}
--regex-bar=/^# close//{scope=pop}{exclusive}

0 comments on commit fc71cc9

Please sign in to comment.