Skip to content

Commit ea96826

Browse files
committed
C++: Add a test of charLoc and subsumes.
1 parent ffad65b commit ea96826

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
void test()
3+
{
4+
1;
5+
2 + 3;
6+
(
7+
4);
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
| charloc.cpp | 1 | 39 | 39 | 1 |
2+
| charloc.cpp | 2 | 48 | 48 | 2 |
3+
| charloc.cpp | 3 | 52 | 52 | 3 |
4+
| charloc.cpp | 4 | 64 | 64 | 4 |
5+
| charloc.cpp | (...) | 65 | 65 | (...) |
6+
| charloc.cpp | ... + ... | 48 | 52 | ... + ..., 2, 3 |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import cpp
2+
3+
from File f, Expr e, Location l, int start, int end
4+
where
5+
e.getLocation() = l and
6+
l.charLoc(f, start, end)
7+
select f.getBaseName(), e.toString(), start, end, concat(Expr e2, Location l2 | e2.getLocation() = l2 and l.subsumes(l2) | e2.toString(), ", ")

0 commit comments

Comments
 (0)