mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
2767 lines
138 KiB
JSON
2767 lines
138 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-ternary-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
27,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
27,
|
|
27
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"a62be2e889a9d188bcbbc97037fb6ff1148a09a1"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index e69de29..a62be2e 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+condition ? case1 : case2;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "785493d3bbdebc780e436799269cfe3ecd5bbf77..1e5394377cdd9791083eaf414c452e2cb8b6b547"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
64,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
52,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
52,
|
|
79
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
79,
|
|
88
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
99,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
105
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
106
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
27,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
27,
|
|
27
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
106,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
106,
|
|
106
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"a62be2e889a9d188bcbbc97037fb6ff1148a09a1",
|
|
"17b4f8ecf738666b8023952ede4139c60b5afcfa"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index a62be2e..17b4f8e 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+x.y = some.condition ? some.case : some.other.case;",
|
|
"+condition ? case1 : case2;",
|
|
" condition ? case1 : case2;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "1e5394377cdd9791083eaf414c452e2cb8b6b547..98fa20a80981b0a1d0bd753fa4780cf00cff37a2"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
64,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
52,
|
|
79
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
27,
|
|
54
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
79,
|
|
88
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
99,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
105
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
106
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
54,
|
|
63
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
71
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
74,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
54,
|
|
81
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
106,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
106,
|
|
106
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
81,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
81
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"17b4f8ecf738666b8023952ede4139c60b5afcfa",
|
|
"aedee5477bd45bd4a388b3981bb19ab75da634d4"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index 17b4f8e..aedee54 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-x.y = some.condition ? some.case : some.other.case;",
|
|
"+condition ? case1 : case2;",
|
|
" condition ? case1 : case2;",
|
|
" condition ? case1 : case2;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "98fa20a80981b0a1d0bd753fa4780cf00cff37a2..c4f454f8f233dc5b769f3c33a9a7c385a9e735c1"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
36
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
53
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
54
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
27,
|
|
54
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
64,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
52,
|
|
79
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
54,
|
|
63
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
71
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
74,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
54,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
54,
|
|
81
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
79,
|
|
88
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
99,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
105
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
106
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
81,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
81
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
106,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
106,
|
|
106
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"aedee5477bd45bd4a388b3981bb19ab75da634d4",
|
|
"17b4f8ecf738666b8023952ede4139c60b5afcfa"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index aedee54..17b4f8e 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-condition ? case1 : case2;",
|
|
"+x.y = some.condition ? some.case : some.other.case;",
|
|
" condition ? case1 : case2;",
|
|
" condition ? case1 : case2;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "c4f454f8f233dc5b769f3c33a9a7c385a9e735c1..0c31925fbae7f9350166413775fa9fec2e0434e6"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
52,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
64,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
52,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
52,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
52,
|
|
79
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
79,
|
|
88
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
99,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
104
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
105
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
79,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
106
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
29,
|
|
30
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
30
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
38,
|
|
47
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
47
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
50,
|
|
54
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
55,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
66
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
67,
|
|
72
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
27,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
27,
|
|
79
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
106,
|
|
106
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
106,
|
|
106
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
79,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
79
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"17b4f8ecf738666b8023952ede4139c60b5afcfa",
|
|
"6fa999d8d1f8afa575b0cfb559c39002218840ea"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index 17b4f8e..6fa999d 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-x.y = some.condition ? some.case : some.other.case;",
|
|
"-condition ? case1 : case2;",
|
|
" condition ? case1 : case2;",
|
|
"+x.y = some.condition ? some.case : some.other.case;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "0c31925fbae7f9350166413775fa9fec2e0434e6..1692cc99588c25ecae57b8dd68e3dd549ffb2907"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
12,
|
|
17
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
20,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
25
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
26
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
27
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
27
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
27,
|
|
28
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
29,
|
|
30
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
30
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
37
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
38,
|
|
47
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
47
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
50,
|
|
54
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
55,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
66
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
67,
|
|
72
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
33,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
27,
|
|
79
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
79,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
79,
|
|
79
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
52,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
52,
|
|
52
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"6fa999d8d1f8afa575b0cfb559c39002218840ea",
|
|
"b63b46d53f087cea5bd6318789341d780610cae6"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index 6fa999d..b63b46d 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-condition ? case1 : case2;",
|
|
" x.y = some.condition ? some.case : some.other.case;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "1692cc99588c25ecae57b8dd68e3dd549ffb2907..401d9a7fba9973bba51744c3bcebdfb16a32ad04"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-ternary-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Assignment",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
1
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
2,
|
|
3
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
3
|
|
]
|
|
},
|
|
{
|
|
"category": "Ternary",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
10
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
11,
|
|
20
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
28,
|
|
32
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
23,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
46,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
35,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
6,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
50
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
51
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
52
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
52,
|
|
52
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
52,
|
|
52
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"ternary.js",
|
|
"ternary.js"
|
|
],
|
|
"oids": [
|
|
"b63b46d53f087cea5bd6318789341d780610cae6",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"ternary.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/ternary.js b/ternary.js",
|
|
"index b63b46d..e69de29 100644",
|
|
"--- a/ternary.js",
|
|
"+++ b/ternary.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-x.y = some.condition ? some.case : some.other.case;"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "401d9a7fba9973bba51744c3bcebdfb16a32ad04..0132d01181719553a7cda6f4d242269546faaa62"
|
|
}]
|