diff --git a/Units/regex-flag-anonymous-gnu.d/args.ctags b/Units/regex-flag-anonymous-gnu.d/args.ctags new file mode 100644 index 0000000000..5d904aafa3 --- /dev/null +++ b/Units/regex-flag-anonymous-gnu.d/args.ctags @@ -0,0 +1,10 @@ +--sort=no + +--langdef=foo +--map-foo=.foo +--kinddef-foo=m,module,modules +--kinddef-foo=x,exception,exceptions + +--regex-foo=/^defmodule\s*(\w+)\s*do/\1/m/{scope=push} +--regex-foo=/^end//{scope=pop}{placeholder} +--regex-foo=/\s+defexception(\s+.*)$//x/{_anonymous=exception}{scope=ref} diff --git a/Units/regex-flag-anonymous-gnu.d/expected.tags b/Units/regex-flag-anonymous-gnu.d/expected.tags new file mode 100644 index 0000000000..1624b61280 --- /dev/null +++ b/Units/regex-flag-anonymous-gnu.d/expected.tags @@ -0,0 +1,4 @@ +MyAppError1 input.foo /^defmodule MyAppError1 do$/;" m +exception4808aff60101 input.foo /^ defexception [:message]$/;" x module:MyAppError1 +MyAppError2 input.foo /^defmodule MyAppError2 do$/;" m +exception4808aff60201 input.foo /^ defexception [:message]$/;" x module:MyAppError2 diff --git a/Units/regex-flag-anonymous-gnu.d/input.foo b/Units/regex-flag-anonymous-gnu.d/input.foo new file mode 100644 index 0000000000..925d0d7f19 --- /dev/null +++ b/Units/regex-flag-anonymous-gnu.d/input.foo @@ -0,0 +1,12 @@ +# +# Taken from commit log subitted by @dreamtigers in #2024. +# +defmodule MyAppError1 do + defexception [:message] + # code +end + +defmodule MyAppError2 do + defexception [:message] + # code +end diff --git a/Units/regex-multiline-flag-dos-gnu.d/args.ctags b/Units/regex-multiline-flag-dos-gnu.d/args.ctags new file mode 100644 index 0000000000..37898a2fc5 --- /dev/null +++ b/Units/regex-multiline-flag-dos-gnu.d/args.ctags @@ -0,0 +1,6 @@ +# Taken from #1473 opened by WillDHB +--langdef=mltest +--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 diff --git a/Units/regex-multiline-flag-dos-gnu.d/expected.tags b/Units/regex-multiline-flag-dos-gnu.d/expected.tags new file mode 100644 index 0000000000..ad92caee50 --- /dev/null +++ b/Units/regex-multiline-flag-dos-gnu.d/expected.tags @@ -0,0 +1,6 @@ +A-SomeEvent input.mlt /^public void catchA(SomeEvent e)$/;" s line:3 language:mltest +B-SomeEvent input.mlt /^public void catchB(SomeEvent e)$/;" s line:10 language:mltest +C-SomeEvent input.mlt /^public void catchC(SomeEvent e)$/;" s line:17 language:mltest +D-SomeEvent input.mlt /^public void catchD(SomeEvent e)$/;" s line:24 language:mltest +E-SomeEvent input.mlt /^public void catchE(SomeEvent e)$/;" s line:33 language:mltest +F-SomeEvent input.mlt /^public void catchF(SomeEvent e)$/;" s line:43 language:mltest diff --git a/Units/regex-multiline-flag-dos-gnu.d/input.mlt b/Units/regex-multiline-flag-dos-gnu.d/input.mlt new file mode 100644 index 0000000000..977cd977c6 --- /dev/null +++ b/Units/regex-multiline-flag-dos-gnu.d/input.mlt @@ -0,0 +1,46 @@ +// Taken from #1473 opened by WillDHB +@subscribe +public void catchA(SomeEvent e) +{ +int x = 4 * 4; +return; +} + +@subscribe +public void catchB(SomeEvent e) +{ +int x = 4 * 4; +return; +} + +@subscribe +public void catchC(SomeEvent e) +{ +int x = 7 * 7 * 7; +return; +} + +@subscribe +public void catchD(SomeEvent e) +{ +int x = 9; + +return; + +} + +@subscribe +public void catchE(SomeEvent e) +{ + +int x = 30; + +return; + +} + +@subscribe +public void catchF(SomeEvent e) +{ +return; +} diff --git a/Units/regex-multiline-flag-gnu.d/args.ctags b/Units/regex-multiline-flag-gnu.d/args.ctags new file mode 100644 index 0000000000..d73690a63a --- /dev/null +++ b/Units/regex-multiline-flag-gnu.d/args.ctags @@ -0,0 +1,5 @@ +--langdef=javaspring +--langmap=javaspring:.java +--mline-regex-javaspring=/@Subscribe\s*[a-z ]+\s*([a-zA-Z]*)\(([a-zA-Z]*)/\1-\2/s,subscription/{mgroup=1} +--excmd=mixed +--fields=+ln diff --git a/Units/regex-multiline-flag-gnu.d/expected.tags b/Units/regex-multiline-flag-gnu.d/expected.tags new file mode 100644 index 0000000000..0a706bb416 --- /dev/null +++ b/Units/regex-multiline-flag-gnu.d/expected.tags @@ -0,0 +1,2 @@ +Event-SomeEvent input.java /^public void catchEvent(SomeEvent e)$/;" s line:2 language:javaspring +recover-Exception input.java /^ recover(Exception e)$/;" s line:10 language:javaspring diff --git a/Units/regex-multiline-flag-gnu.d/input.java b/Units/regex-multiline-flag-gnu.d/input.java new file mode 100644 index 0000000000..cc04db7cd2 --- /dev/null +++ b/Units/regex-multiline-flag-gnu.d/input.java @@ -0,0 +1,13 @@ +@Subscribe +public void catchEvent(SomeEvent e) +{ + return; +} + + +@Subscribe +public void + recover(Exception e) +{ + return; +} diff --git a/Units/regex-multiline-flag-hat-and-doller-gnu.d/args.ctags b/Units/regex-multiline-flag-hat-and-doller-gnu.d/args.ctags new file mode 100644 index 0000000000..2fca370548 --- /dev/null +++ b/Units/regex-multiline-flag-hat-and-doller-gnu.d/args.ctags @@ -0,0 +1,7 @@ +--langdef=FOOBAR +--langmap=FOOBAR:.foobar +--kinddef-FOOBAR=d,def,definitions +--kinddef-FOOBAR=D,Def,Definitions +--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 diff --git a/Units/regex-multiline-flag-hat-and-doller-gnu.d/expected.tags b/Units/regex-multiline-flag-hat-and-doller-gnu.d/expected.tags new file mode 100644 index 0000000000..2db81e4aa1 --- /dev/null +++ b/Units/regex-multiline-flag-hat-and-doller-gnu.d/expected.tags @@ -0,0 +1,7 @@ +a input.foobar /^ a$/;" D line:2 language:FOOBAR +a input.foobar /^ a$/;" d line:2 language:FOOBAR +b input.foobar /^ b$/;" D line:4 language:FOOBAR +b input.foobar /^ b$/;" d line:4 language:FOOBAR +c input.foobar /^ c$/;" D line:6 language:FOOBAR +c input.foobar /^ c$/;" d line:6 language:FOOBAR +d input.foobar /^ d$/;" D line:8 language:FOOBAR diff --git a/Units/regex-multiline-flag-hat-and-doller-gnu.d/input.foobar b/Units/regex-multiline-flag-hat-and-doller-gnu.d/input.foobar new file mode 100644 index 0000000000..84d9632e4c --- /dev/null +++ b/Units/regex-multiline-flag-hat-and-doller-gnu.d/input.foobar @@ -0,0 +1,9 @@ +def + a +def + b +def + c +# def + d + diff --git a/Units/regex-multiline-flag-newline-gnu.d/args.ctags b/Units/regex-multiline-flag-newline-gnu.d/args.ctags new file mode 100644 index 0000000000..8398b5ab36 --- /dev/null +++ b/Units/regex-multiline-flag-newline-gnu.d/args.ctags @@ -0,0 +1,5 @@ +--langdef=FOOBAR +--langmap=FOOBAR:.foobar +--kinddef-FOOBAR=d,def,definitions +--mline-regex-foobar=/^def(\n[\n\t]|: )(\w+)/\2/d/{mgroup=2} +--fields=+ln diff --git a/Units/regex-multiline-flag-newline-gnu.d/expected.tags b/Units/regex-multiline-flag-newline-gnu.d/expected.tags new file mode 100644 index 0000000000..7ae01d629b --- /dev/null +++ b/Units/regex-multiline-flag-newline-gnu.d/expected.tags @@ -0,0 +1,3 @@ +captureme0 input.foobar /^def: captureme0$/;" d line:4 language:FOOBAR +captureme1 input.foobar /^captureme1$/;" d line:8 language:FOOBAR +captureme2 input.foobar /^ captureme2$/;" d line:15 language:FOOBAR diff --git a/Units/regex-multiline-flag-newline-gnu.d/input.foobar b/Units/regex-multiline-flag-newline-gnu.d/input.foobar new file mode 100644 index 0000000000..f8fef1e4b4 --- /dev/null +++ b/Units/regex-multiline-flag-newline-gnu.d/input.foobar @@ -0,0 +1,17 @@ +def +dont-cptureme0 + +def: captureme0 + +def + +captureme1 + +def + + +dont-captureme1 +def + captureme2 + + diff --git a/Units/regex-with-scope-autoFQTag-gnu.d/args.ctags b/Units/regex-with-scope-autoFQTag-gnu.d/args.ctags new file mode 100644 index 0000000000..2eb85a84b7 --- /dev/null +++ b/Units/regex-with-scope-autoFQTag-gnu.d/args.ctags @@ -0,0 +1,16 @@ +# To check the output easier +--sort=no +--fields=+e +--extras=+q + +--langdef=foo{_autoFQTag} + --map-foo=+.foo + --regex-foo=/^#.*//{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} diff --git a/Units/regex-with-scope-autoFQTag-gnu.d/expected.tags b/Units/regex-with-scope-autoFQTag-gnu.d/expected.tags new file mode 100644 index 0000000000..d18be0684f --- /dev/null +++ b/Units/regex-with-scope-autoFQTag-gnu.d/expected.tags @@ -0,0 +1,37 @@ +NS1 input.foo /^ns NS1$/;" n end:16 +x input.foo /^define x {$/;" d namespace:NS1 end:14 +NS1.x input.foo /^define x {$/;" d namespace:NS1 end:14 +y input.foo /^ define y {$/;" d definition:NS1.x end:7 +NS1.x.y input.foo /^ define y {$/;" d definition:NS1.x end:7 +v_y_0 input.foo /^ var v_y_0$/;" v definition:NS1.x.y +NS1.x.y.v_y_0 input.foo /^ var v_y_0$/;" v definition:NS1.x.y +v_y_1 input.foo /^ var v_y_1$/;" v definition:NS1.x.y +NS1.x.y.v_y_1 input.foo /^ var v_y_1$/;" v definition:NS1.x.y +z input.foo /^ define z {$/;" d definition:NS1.x end:13 +NS1.x.z input.foo /^ define z {$/;" d definition:NS1.x end:13 +v_z_0 input.foo /^ var v_z_0$/;" v definition:NS1.x.z +NS1.x.z.v_z_0 input.foo /^ var v_z_0$/;" v definition:NS1.x.z +v_z_1 input.foo /^ var v_z_1$/;" v definition:NS1.x.z +NS1.x.z.v_z_1 input.foo /^ var v_z_1$/;" v definition:NS1.x.z +a input.foo /^ define a {$/;" d definition:NS1.x.z end:12 +NS1.x.z.a input.foo /^ define a {$/;" d definition:NS1.x.z end:12 +NS2 input.foo /^ns NS2$/;" n end:24 +p input.foo /^define p {$/;" d namespace:NS2 end:22 +NS2.p input.foo /^define p {$/;" d namespace:NS2 end:22 +q input.foo /^ define q {$/;" d definition:NS2.p end:21 +NS2.p.q input.foo /^ define q {$/;" d definition:NS2.p end:21 +v_g1 input.foo /^var v_g1$/;" v +d_g input.foo /^define d_g {$/;" d end:28 +v_l input.foo /^ var v_l$/;" v definition:d_g +d_g.v_l input.foo /^ var v_l$/;" v definition:d_g +NS3 input.foo /^ns NS3$/;" n end:47 +PACKAGE input.foo /^package PACKAGE$/;" p namespace:NS3 end:44 +NS3.PACKAGE input.foo /^package PACKAGE$/;" p namespace:NS3 end:44 +p input.foo /^define p {$/;" d package:NS3.PACKAGE end:41 +NS3.PACKAGE.p input.foo /^define p {$/;" d package:NS3.PACKAGE end:41 +q input.foo /^ define q {$/;" d definition:NS3.PACKAGE.p end:38 +NS3.PACKAGE.p.q input.foo /^ define q {$/;" d definition:NS3.PACKAGE.p end:38 +L input.foo /^ var L$/;" v definition:NS3.PACKAGE.p.q +NS3.PACKAGE.p.q.L input.foo /^ var L$/;" v definition:NS3.PACKAGE.p.q +v_g2 input.foo /^var v_g2$/;" v namespace:NS3 +NS3.v_g2 input.foo /^var v_g2$/;" v namespace:NS3 diff --git a/Units/regex-with-scope-autoFQTag-gnu.d/input.foo b/Units/regex-with-scope-autoFQTag-gnu.d/input.foo new file mode 100644 index 0000000000..bbd46beed2 --- /dev/null +++ b/Units/regex-with-scope-autoFQTag-gnu.d/input.foo @@ -0,0 +1,47 @@ +# open:X +ns NS1 +define x { + define y { + var v_y_0 + var v_y_1 + } + define z { + var v_z_0 + var v_z_1 + define a { + } + } +} + +ns NS2 +define p { +# def:WRAPPER + define q { + print + } +} + +global +var v_g1 +define d_g { + var v_l +} + +ns NS3 +package PACKAGE +define p { + define q { + print + { + var L + } + } + +# end of define +} + +# end of package +end + +var v_g2 +# close diff --git a/Units/regex-with-scope-gnu.d/args.ctags b/Units/regex-with-scope-gnu.d/args.ctags new file mode 100644 index 0000000000..3b053e1b92 --- /dev/null +++ b/Units/regex-with-scope-gnu.d/args.ctags @@ -0,0 +1,14 @@ +# To check the output easier +--sort=no + +--langdef=foo + --map-foo=+.foo + --regex-foo=/^#.*//{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} diff --git a/Units/regex-with-scope-gnu.d/expected.tags b/Units/regex-with-scope-gnu.d/expected.tags new file mode 100644 index 0000000000..3a6c44eb87 --- /dev/null +++ b/Units/regex-with-scope-gnu.d/expected.tags @@ -0,0 +1,21 @@ +NS1 input.foo /^ns NS1$/;" n +x input.foo /^define x {$/;" d namespace:NS1 +y input.foo /^ define y {$/;" d definition:NS1.x +v_y_0 input.foo /^ var v_y_0$/;" v definition:NS1.x.y +v_y_1 input.foo /^ var v_y_1$/;" v definition:NS1.x.y +z input.foo /^ define z {$/;" d definition:NS1.x +v_z_0 input.foo /^ var v_z_0$/;" v definition:NS1.x.z +v_z_1 input.foo /^ var v_z_1$/;" v definition:NS1.x.z +a input.foo /^ define a {$/;" d definition:NS1.x.z +NS2 input.foo /^ns NS2$/;" n +p input.foo /^define p {$/;" d namespace:NS2 +q input.foo /^ define q {$/;" d definition:NS2.p +v_g1 input.foo /^var v_g1$/;" v +d_g input.foo /^define d_g {$/;" d +v_l input.foo /^ var v_l$/;" v definition:d_g +NS3 input.foo /^ns NS3$/;" n +PACKAGE input.foo /^package PACKAGE$/;" p namespace:NS3 +p input.foo /^define p {$/;" d package:NS3.PACKAGE +q input.foo /^ define q {$/;" d definition:NS3.PACKAGE.p +L input.foo /^ var L$/;" v definition:NS3.PACKAGE.p.q +v_g2 input.foo /^var v_g2$/;" v namespace:NS3 diff --git a/Units/regex-with-scope-gnu.d/input.foo b/Units/regex-with-scope-gnu.d/input.foo new file mode 100644 index 0000000000..41eafd79a1 --- /dev/null +++ b/Units/regex-with-scope-gnu.d/input.foo @@ -0,0 +1,44 @@ +ns NS1 +define x { + define y { + var v_y_0 + var v_y_1 + } + define z { + var v_z_0 + var v_z_1 + define a { + } + } +} + +ns NS2 +define p { + define q { + print + } +} + +global +var v_g1 +define d_g { + var v_l +} + +ns NS3 +package PACKAGE +define p { + define q { + print + { + var L + } + } + +# end of define +} + +# end of package +end + +var v_g2 diff --git a/Units/regex-with-scope-nested-gnu.d/args.ctags b/Units/regex-with-scope-nested-gnu.d/args.ctags new file mode 100644 index 0000000000..0e716091e1 --- /dev/null +++ b/Units/regex-with-scope-nested-gnu.d/args.ctags @@ -0,0 +1,22 @@ +# To check the output easier +--sort=no +--fields=+e + +--langdef=foo + --map-foo=+.foo + --regex-foo=/^#.*//{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:(\w+)/\1/s/{scope=push} + --regex-bar=/^# def:(\w+)/\1/d/{scope=ref} + --regex-bar=/^# close//{scope=pop}{exclusive} diff --git a/Units/regex-with-scope-nested-gnu.d/expected.tags b/Units/regex-with-scope-nested-gnu.d/expected.tags new file mode 100644 index 0000000000..00331d4e6d --- /dev/null +++ b/Units/regex-with-scope-nested-gnu.d/expected.tags @@ -0,0 +1,23 @@ +X input.foo /^# open:X$/;" s end:47 +NS1 input.foo /^ns NS1$/;" n end:16 +x input.foo /^define x {$/;" d namespace:NS1 end:14 +y input.foo /^ define y {$/;" d definition:NS1.x end:7 +v_y_0 input.foo /^ var v_y_0$/;" v definition:NS1.x.y +v_y_1 input.foo /^ var v_y_1$/;" v definition:NS1.x.y +z input.foo /^ define z {$/;" d definition:NS1.x end:13 +v_z_0 input.foo /^ var v_z_0$/;" v definition:NS1.x.z +v_z_1 input.foo /^ var v_z_1$/;" v definition:NS1.x.z +a input.foo /^ define a {$/;" d definition:NS1.x.z end:12 +NS2 input.foo /^ns NS2$/;" n end:24 +p input.foo /^define p {$/;" d namespace:NS2 end:22 +WRAPPER input.foo /^# def:WRAPPER$/;" d scope:X +q input.foo /^ define q {$/;" d definition:NS2.p end:21 +v_g1 input.foo /^var v_g1$/;" v +d_g input.foo /^define d_g {$/;" d end:28 +v_l input.foo /^ var v_l$/;" v definition:d_g +NS3 input.foo /^ns NS3$/;" n end:47 +PACKAGE input.foo /^package PACKAGE$/;" p namespace:NS3 end:44 +p input.foo /^define p {$/;" d package:NS3.PACKAGE end:41 +q input.foo /^ define q {$/;" d definition:NS3.PACKAGE.p end:38 +L input.foo /^ var L$/;" v definition:NS3.PACKAGE.p.q +v_g2 input.foo /^var v_g2$/;" v namespace:NS3 diff --git a/Units/regex-with-scope-nested-gnu.d/input.foo b/Units/regex-with-scope-nested-gnu.d/input.foo new file mode 100644 index 0000000000..bbd46beed2 --- /dev/null +++ b/Units/regex-with-scope-nested-gnu.d/input.foo @@ -0,0 +1,47 @@ +# open:X +ns NS1 +define x { + define y { + var v_y_0 + var v_y_1 + } + define z { + var v_z_0 + var v_z_1 + define a { + } + } +} + +ns NS2 +define p { +# def:WRAPPER + define q { + print + } +} + +global +var v_g1 +define d_g { + var v_l +} + +ns NS3 +package PACKAGE +define p { + define q { + print + { + var L + } + } + +# end of define +} + +# end of package +end + +var v_g2 +# close