Skip to content

Commit 44cc044

Browse files
committed
C#: Add testcase for extended property patterns (to indicate that they are de-sugared correctly).
1 parent 833e8e4 commit 44cc044

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
propertyPatterns
2+
| PropertyPatterns.cs:14:18:14:33 | { ... } |
3+
| PropertyPatterns.cs:14:24:14:31 | { ... } |
4+
| PropertyPatterns.cs:18:18:18:28 | { ... } |
5+
| PropertyPatterns.cs:18:20:18:21 | { ... } |
6+
| PropertyPatterns.cs:25:18:25:40 | { ... } |
7+
| PropertyPatterns.cs:25:23:25:38 | { ... } |
8+
| PropertyPatterns.cs:25:29:25:36 | { ... } |
9+
| PropertyPatterns.cs:29:18:29:30 | { ... } |
10+
| PropertyPatterns.cs:29:20:29:20 | { ... } |
11+
| PropertyPatterns.cs:29:22:29:23 | { ... } |
12+
| PropertyPatterns.cs:36:18:36:35 | { ... } |
13+
| PropertyPatterns.cs:36:23:36:33 | { ... } |
14+
| PropertyPatterns.cs:36:25:36:26 | { ... } |
15+
| PropertyPatterns.cs:40:18:40:35 | { ... } |
16+
| PropertyPatterns.cs:40:20:40:20 | { ... } |
17+
| PropertyPatterns.cs:40:26:40:33 | { ... } |
18+
| PropertyPatterns.cs:47:18:47:47 | { ... } |
19+
| PropertyPatterns.cs:47:24:47:31 | { ... } |
20+
| PropertyPatterns.cs:47:38:47:45 | { ... } |
21+
| PropertyPatterns.cs:51:18:51:38 | { ... } |
22+
| PropertyPatterns.cs:51:20:51:21 | { ... } |
23+
| PropertyPatterns.cs:51:29:51:30 | { ... } |
24+
propertyPatternChild
25+
| PropertyPatterns.cs:14:18:14:33 | { ... } | 0 | PropertyPatterns.cs:14:24:14:31 | { ... } |
26+
| PropertyPatterns.cs:14:24:14:31 | { ... } | 0 | PropertyPatterns.cs:14:29:14:29 | 1 |
27+
| PropertyPatterns.cs:18:18:18:28 | { ... } | 0 | PropertyPatterns.cs:18:20:18:21 | { ... } |
28+
| PropertyPatterns.cs:18:20:18:21 | { ... } | 0 | PropertyPatterns.cs:18:26:18:26 | 2 |
29+
| PropertyPatterns.cs:25:18:25:40 | { ... } | 0 | PropertyPatterns.cs:25:23:25:38 | { ... } |
30+
| PropertyPatterns.cs:25:23:25:38 | { ... } | 0 | PropertyPatterns.cs:25:29:25:36 | { ... } |
31+
| PropertyPatterns.cs:25:29:25:36 | { ... } | 0 | PropertyPatterns.cs:25:34:25:34 | 3 |
32+
| PropertyPatterns.cs:29:18:29:30 | { ... } | 0 | PropertyPatterns.cs:29:20:29:20 | { ... } |
33+
| PropertyPatterns.cs:29:20:29:20 | { ... } | 0 | PropertyPatterns.cs:29:22:29:23 | { ... } |
34+
| PropertyPatterns.cs:29:22:29:23 | { ... } | 0 | PropertyPatterns.cs:29:28:29:28 | 4 |
35+
| PropertyPatterns.cs:36:18:36:35 | { ... } | 0 | PropertyPatterns.cs:36:23:36:33 | { ... } |
36+
| PropertyPatterns.cs:36:23:36:33 | { ... } | 0 | PropertyPatterns.cs:36:25:36:26 | { ... } |
37+
| PropertyPatterns.cs:36:25:36:26 | { ... } | 0 | PropertyPatterns.cs:36:31:36:31 | 5 |
38+
| PropertyPatterns.cs:40:18:40:35 | { ... } | 0 | PropertyPatterns.cs:40:20:40:20 | { ... } |
39+
| PropertyPatterns.cs:40:20:40:20 | { ... } | 0 | PropertyPatterns.cs:40:26:40:33 | { ... } |
40+
| PropertyPatterns.cs:40:26:40:33 | { ... } | 0 | PropertyPatterns.cs:40:31:40:31 | 6 |
41+
| PropertyPatterns.cs:47:18:47:47 | { ... } | 0 | PropertyPatterns.cs:47:24:47:31 | { ... } |
42+
| PropertyPatterns.cs:47:18:47:47 | { ... } | 1 | PropertyPatterns.cs:47:38:47:45 | { ... } |
43+
| PropertyPatterns.cs:47:24:47:31 | { ... } | 0 | PropertyPatterns.cs:47:29:47:29 | 7 |
44+
| PropertyPatterns.cs:47:38:47:45 | { ... } | 0 | PropertyPatterns.cs:47:43:47:43 | 8 |
45+
| PropertyPatterns.cs:51:18:51:38 | { ... } | 0 | PropertyPatterns.cs:51:20:51:21 | { ... } |
46+
| PropertyPatterns.cs:51:18:51:38 | { ... } | 1 | PropertyPatterns.cs:51:29:51:30 | { ... } |
47+
| PropertyPatterns.cs:51:20:51:21 | { ... } | 0 | PropertyPatterns.cs:51:26:51:26 | 9 |
48+
| PropertyPatterns.cs:51:29:51:30 | { ... } | 0 | PropertyPatterns.cs:51:35:51:36 | 10 |
49+
propertyPatternLabels
50+
| PropertyPatterns.cs:14:24:14:31 | { ... } | P1 |
51+
| PropertyPatterns.cs:14:29:14:29 | 1 | X |
52+
| PropertyPatterns.cs:18:20:18:21 | { ... } | P1 |
53+
| PropertyPatterns.cs:18:26:18:26 | 2 | X |
54+
| PropertyPatterns.cs:25:23:25:38 | { ... } | L |
55+
| PropertyPatterns.cs:25:29:25:36 | { ... } | P2 |
56+
| PropertyPatterns.cs:25:34:25:34 | 3 | Y |
57+
| PropertyPatterns.cs:29:20:29:20 | { ... } | L |
58+
| PropertyPatterns.cs:29:22:29:23 | { ... } | P2 |
59+
| PropertyPatterns.cs:29:28:29:28 | 4 | Y |
60+
| PropertyPatterns.cs:36:23:36:33 | { ... } | L |
61+
| PropertyPatterns.cs:36:25:36:26 | { ... } | P2 |
62+
| PropertyPatterns.cs:36:31:36:31 | 5 | Y |
63+
| PropertyPatterns.cs:40:20:40:20 | { ... } | L |
64+
| PropertyPatterns.cs:40:26:40:33 | { ... } | P2 |
65+
| PropertyPatterns.cs:40:31:40:31 | 6 | Y |
66+
| PropertyPatterns.cs:47:24:47:31 | { ... } | P1 |
67+
| PropertyPatterns.cs:47:29:47:29 | 7 | X |
68+
| PropertyPatterns.cs:47:38:47:45 | { ... } | P1 |
69+
| PropertyPatterns.cs:47:43:47:43 | 8 | Y |
70+
| PropertyPatterns.cs:51:20:51:21 | { ... } | P1 |
71+
| PropertyPatterns.cs:51:26:51:26 | 9 | X |
72+
| PropertyPatterns.cs:51:29:51:30 | { ... } | P1 |
73+
| PropertyPatterns.cs:51:35:51:36 | 10 | Y |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import csharp
2+
3+
query predicate propertyPatterns(PropertyPatternExpr exp) { any() }
4+
5+
query predicate propertyPatternChild(PropertyPatternExpr pp, int n, PatternExpr child) {
6+
child = pp.getPattern(n)
7+
}
8+
9+
query predicate propertyPatternLabels(LabeledPatternExpr exp, string label) {
10+
label = exp.getLabel()
11+
}

0 commit comments

Comments
 (0)