mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
2719 lines
130 KiB
JSON
2719 lines
130 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-if-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
19,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
19,
|
|
19
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"52d4b4f029e49c6d3fe0b70fffb8fd7e372b159d"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index e69de29..52d4b4f 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+if (x) { log(y); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "1414e435bed741828bc662b2617b65f006198115..f925589600daebd1c530948026f8ca735c3d2295"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
29
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
37,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
43
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
56,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
62
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
19,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
19,
|
|
19
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
62,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
62,
|
|
62
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"52d4b4f029e49c6d3fe0b70fffb8fd7e372b159d",
|
|
"ae4ee3281f01d0b2140f61a307913f9d2a58ef60"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index 52d4b4f..ae4ee32 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+if (a.b) { log(c); d; }",
|
|
"+if (x) { log(y); }",
|
|
" if (x) { log(y); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f925589600daebd1c530948026f8ca735c3d2295..953b51e76de53d368e5aaeedb84b46cec9e2ac83"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "replace",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "replace",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
29
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
37,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
43
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
31
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
26,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
19,
|
|
38
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
56,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
62
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
51,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
47,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
47,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
45,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
38,
|
|
57
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
62,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
62,
|
|
62
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
57,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
57,
|
|
57
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"ae4ee3281f01d0b2140f61a307913f9d2a58ef60",
|
|
"df55832d41035a032304fc955c0e431962b04cb5"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index ae4ee32..df55832 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-if (a.b) { log(c); d; }",
|
|
"+if (x) { log(y); }",
|
|
" if (x) { log(y); }",
|
|
" if (x) { log(y); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "953b51e76de53d368e5aaeedb84b46cec9e2ac83..bed63a4361da46793cece7c3f1370d78fd311348"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "replace",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "replace",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
31
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
26,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
19,
|
|
38
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
29
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
37,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
43
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
51,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
47,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
47,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
45,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
38,
|
|
57
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
56,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
62
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
57,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
57,
|
|
57
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
62,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
62,
|
|
62
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"df55832d41035a032304fc955c0e431962b04cb5",
|
|
"ae4ee3281f01d0b2140f61a307913f9d2a58ef60"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index df55832..ae4ee32 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-if (x) { log(y); }",
|
|
"+if (a.b) { log(c); d; }",
|
|
" if (x) { log(y); }",
|
|
" if (x) { log(y); }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "bed63a4361da46793cece7c3f1370d78fd311348..1d1e851c9148d9e8b3e8d6d7ff8e46412e33b7f5"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
29
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
37,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
24,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
43
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
56,
|
|
57
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
61
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
43,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
62
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
25,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
30,
|
|
33
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
38,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
19,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
19,
|
|
43
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
62,
|
|
62
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
62,
|
|
62
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
43,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
43
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"ae4ee3281f01d0b2140f61a307913f9d2a58ef60",
|
|
"38b83efe7795ac278ad6f742950f313cf761c71e"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index ae4ee32..38b83ef 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-if (a.b) { log(c); d; }",
|
|
"-if (x) { log(y); }",
|
|
" if (x) { log(y); }",
|
|
"+if (a.b) { log(c); d; }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "1d1e851c9148d9e8b3e8d6d7ff8e46412e33b7f5..bfee3fdff9441afb2bfac9650139f2fe3517d1fb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
12
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
13,
|
|
14
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
7,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
19
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
19
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
25,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
26
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
30,
|
|
33
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
38,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
38,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
19,
|
|
43
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
43,
|
|
43
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
43,
|
|
43
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
24,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
24,
|
|
24
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"38b83efe7795ac278ad6f742950f313cf761c71e",
|
|
"f67163bb3b414d4f572ccb103f91d3722899787f"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index 38b83ef..f67163b 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-if (x) { log(y); }",
|
|
" if (a.b) { log(c); d; }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "bfee3fdff9441afb2bfac9650139f2fe3517d1fb..199fb9c9073c557c909722b9586409dc8ca619d7"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-if-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "If",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
4,
|
|
5
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
7
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
4,
|
|
7
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
14
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
15,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
17
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
11,
|
|
18
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
21
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
23
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
24
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
24,
|
|
24
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
24,
|
|
24
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"if.js",
|
|
"if.js"
|
|
],
|
|
"oids": [
|
|
"f67163bb3b414d4f572ccb103f91d3722899787f",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"if.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/if.js b/if.js",
|
|
"index f67163b..e69de29 100644",
|
|
"--- a/if.js",
|
|
"+++ b/if.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-if (a.b) { log(c); d; }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "199fb9c9073c557c909722b9586409dc8ca619d7..a7c68af9b8e2a95ea64781f7701d616d9831d54b"
|
|
}]
|