Skip to content

Commit 2806c9a

Browse files
committed
Units: copy regex tests on which GNU extension can be used.
1 parent 41d7384 commit 2806c9a

File tree

24 files changed

+423
-0
lines changed

24 files changed

+423
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--sort=no
2+
3+
--langdef=foo
4+
--map-foo=.foo
5+
--kinddef-foo=m,module,modules
6+
--kinddef-foo=x,exception,exceptions
7+
8+
--regex-foo=/^defmodule *([a-zA-Z0-9]+) *do/\1/m/{scope=push}
9+
--regex-foo=/^end//{scope=pop}{placeholder}
10+
--regex-foo=/ +defexception( +.*)$//x/{_anonymous=exception}{scope=ref}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MyAppError1 input.foo /^defmodule MyAppError1 do$/;" m
2+
exceptionf9e1959f0101 input.foo /^ defexception [:message]$/;" x module:MyAppError1
3+
MyAppError2 input.foo /^defmodule MyAppError2 do$/;" m
4+
exceptionf9e1959f0201 input.foo /^ defexception [:message]$/;" x module:MyAppError2
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Taken from commit log subitted by @dreamtigers in #2024.
3+
#
4+
defmodule MyAppError1 do
5+
defexception [:message]
6+
# code
7+
end
8+
9+
defmodule MyAppError2 do
10+
defexception [:message]
11+
# code
12+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Taken from #1473 opened by WillDHB
2+
--langdef=mltest
3+
--mline-regex-mltest=/@subscribe([[:space:]])*([a-z ]+)[[:space:]]*([a-zA-Z]*)\(([a-zA-Z]*)/\3-\4/s,subscription/{mgroup=3}
4+
--excmd=mixed
5+
--fields=+ln
6+
--language-force=mltest
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
A-SomeEvent input.mlt /^public void catchA(SomeEvent e)$/;" s line:3 language:mltest
2+
B-SomeEvent input.mlt /^public void catchB(SomeEvent e)$/;" s line:10 language:mltest
3+
C-SomeEvent input.mlt /^public void catchC(SomeEvent e)$/;" s line:17 language:mltest
4+
D-SomeEvent input.mlt /^public void catchD(SomeEvent e)$/;" s line:24 language:mltest
5+
E-SomeEvent input.mlt /^public void catchE(SomeEvent e)$/;" s line:33 language:mltest
6+
F-SomeEvent input.mlt /^public void catchF(SomeEvent e)$/;" s line:43 language:mltest
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Taken from #1473 opened by WillDHB
2+
@subscribe
3+
public void catchA(SomeEvent e)
4+
{
5+
int x = 4 * 4;
6+
return;
7+
}
8+
9+
@subscribe
10+
public void catchB(SomeEvent e)
11+
{
12+
int x = 4 * 4;
13+
return;
14+
}
15+
16+
@subscribe
17+
public void catchC(SomeEvent e)
18+
{
19+
int x = 7 * 7 * 7;
20+
return;
21+
}
22+
23+
@subscribe
24+
public void catchD(SomeEvent e)
25+
{
26+
int x = 9;
27+
28+
return;
29+
30+
}
31+
32+
@subscribe
33+
public void catchE(SomeEvent e)
34+
{
35+
36+
int x = 30;
37+
38+
return;
39+
40+
}
41+
42+
@subscribe
43+
public void catchF(SomeEvent e)
44+
{
45+
return;
46+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--langdef=javaspring
2+
--langmap=javaspring:.java
3+
--mline-regex-javaspring=/@Subscribe([[:space:]])*([a-z ]+)[[:space:]]*([a-zA-Z]*)\(([a-zA-Z]*)/\3-\4/s,subscription/{mgroup=3}
4+
--excmd=mixed
5+
--fields=+ln
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Event-SomeEvent input.java /^public void catchEvent(SomeEvent e)$/;" s line:2 language:javaspring
2+
recover-Exception input.java /^ recover(Exception e)$/;" s line:10 language:javaspring
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@Subscribe
2+
public void catchEvent(SomeEvent e)
3+
{
4+
return;
5+
}
6+
7+
8+
@Subscribe
9+
public void
10+
recover(Exception e)
11+
{
12+
return;
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--langdef=FOOBAR
2+
--langmap=FOOBAR:.foobar
3+
--kinddef-FOOBAR=d,def,definitions
4+
--kinddef-FOOBAR=D,Def,Definitions
5+
--mline-regex-foobar=/^def[\n\t ]+([a-z]+)$/\1/d/{mgroup=1}
6+
--mline-regex-foobar=/[\n]?def[\n\t ]+([a-z]+)\n/\1/D/{mgroup=1}
7+
--fields=+ln

0 commit comments

Comments
 (0)