Skip to content

Commit 440b311

Browse files
authored
Merge pull request #686 from owen-mc/extract-generics
Extract generics
2 parents ef7363c + c0fbd03 commit 440b311

File tree

66 files changed

+5229
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5229
-184
lines changed

.github/workflows/codeqltest.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99

10-
- name: Set up Go 1.17
10+
- name: Set up Go 1.18.1
1111
uses: actions/setup-go@v1
1212
with:
13-
go-version: 1.17
13+
go-version: 1.18.1
1414
id: go
1515

1616
- name: Set up CodeQL CLI
@@ -59,10 +59,10 @@ jobs:
5959
name: Test MacOS
6060
runs-on: macOS-latest
6161
steps:
62-
- name: Set up Go 1.17
62+
- name: Set up Go 1.18.1
6363
uses: actions/setup-go@v1
6464
with:
65-
go-version: 1.17
65+
go-version: 1.18.1
6666
id: go
6767

6868
- name: Set up CodeQL CLI
@@ -99,10 +99,10 @@ jobs:
9999
name: Test Windows
100100
runs-on: windows-2019
101101
steps:
102-
- name: Set up Go 1.17
102+
- name: Set up Go 1.18.1
103103
uses: actions/setup-go@v1
104104
with:
105-
go-version: 1.17
105+
go-version: 1.18.1
106106
id: go
107107

108108
- name: Set up CodeQL CLI
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class Expr_ extends @expr {
2+
string toString() { result = "Expr" }
3+
}
4+
5+
class ExprParent_ extends @exprparent {
6+
string toString() { result = "ExprParent" }
7+
}
8+
9+
/**
10+
* Two new kinds have been inserted such that `@sliceexpr` which used to have
11+
* index 13 now has index 15. Another new kind has been inserted such that
12+
* `@plusexpr` which used to have index 23 now has index 26. Entries with
13+
* indices lower than 13 are unchanged.
14+
*/
15+
bindingset[new_index]
16+
int old_index(int new_index) {
17+
if new_index < 13
18+
then result = new_index
19+
else
20+
if new_index = [13, 14]
21+
then result = 0 // badexpr
22+
else
23+
if new_index < 23
24+
then result + (15 - 13) = new_index
25+
else
26+
if new_index = 23
27+
then result = 0 // badexpr
28+
else result + (26 - 23) = new_index
29+
}
30+
31+
// The schema for exprs is:
32+
//
33+
// exprs(unique int id: @expr,
34+
// int kind: int ref,
35+
// int parent: @exprparent ref,
36+
// int idx: int ref);
37+
from Expr_ expr, int new_kind, ExprParent_ parent, int idx, int old_kind
38+
where
39+
exprs(expr, new_kind, parent, idx) and
40+
old_kind = old_index(new_kind)
41+
select expr, old_kind, parent, idx

0 commit comments

Comments
 (0)