mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
2224 lines
101 KiB
JSON
2224 lines
101 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-while-statement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"1ea2800e0ca7a6b41ac577d898eec51c21ad962a"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "ae1968ad1d203b12a667f6eee6ff8c752fed7a01",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "b858728df3fe923e42c0f371d0f969ff75104346"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"1ea2800e0ca7a6b41ac577d898eec51c21ad962a",
|
|
"c322323db2c1f69ea9937e346fe02f353d747421"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "b858728df3fe923e42c0f371d0f969ff75104346",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "b458a44e24f98f15ed3f43bebe6ca965a545e67f"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"c322323db2c1f69ea9937e346fe02f353d747421",
|
|
"ea967164613fa8014fc806c3847699f5a0b4a2ce"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "b458a44e24f98f15ed3f43bebe6ca965a545e67f",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "192d77ad2e020fea55da6626ec67e6bb41127fca"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"ea967164613fa8014fc806c3847699f5a0b4a2ce",
|
|
"c322323db2c1f69ea9937e346fe02f353d747421"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "192d77ad2e020fea55da6626ec67e6bb41127fca",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "af8c95de9f62b9a86993f524436108ad2b4a4307"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
48
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
55
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
56
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
40,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
60
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
60,
|
|
60
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
60,
|
|
60
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
40,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
40
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"c322323db2c1f69ea9937e346fe02f353d747421",
|
|
"28f4b2107aeca302af288a59f29d76c30c9dc0ed"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "af8c95de9f62b9a86993f524436108ad2b4a4307",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "f1358d06ec5140bf6595f2e63e62f3aaf1839463"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
32,
|
|
33
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
32,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
30,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
20,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
40
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
40,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
40,
|
|
40
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"28f4b2107aeca302af288a59f29d76c30c9dc0ed",
|
|
"e185b25d092e4a5402a6033691dcc52be2c7a8aa"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "f1358d06ec5140bf6595f2e63e62f3aaf1839463",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "8e5b8eae41564fa06346d55d1055cf0ee0f102c7"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-while-statement-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "While",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
7,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "FunctionCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
13
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
15
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
16
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
10,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
18
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
20
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
20,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
20,
|
|
20
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"while-statement.js",
|
|
"while-statement.js"
|
|
],
|
|
"oids": [
|
|
"e185b25d092e4a5402a6033691dcc52be2c7a8aa",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"while-statement.js"
|
|
],
|
|
"sha1": "8e5b8eae41564fa06346d55d1055cf0ee0f102c7",
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"sha2": "ecf8cd8052db6b30a820c1aa31afe58cadc89c7c"
|
|
}]
|