Compact parser fixture loc info (#11322)

* chore: compact loc information in parser fixtures

* chore: update test fixtures
This commit is contained in:
Huáng Jùnliàng
2020-03-23 20:10:29 -04:00
committed by GitHub
parent 6a728a05a8
commit dc7c5640e9
3793 changed files with 38861 additions and 472314 deletions

View File

@@ -1,63 +1,18 @@
{
"type": "File",
"start": 0,
"end": 141,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 9,
"column": 1
}
},
"start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}},
"program": {
"type": "Program",
"start": 0,
"end": 141,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 9,
"column": 1
}
},
"start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 141,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 9,
"column": 1
}
},
"start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}},
"id": {
"type": "Identifier",
"start": 9,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 12
},
"identifierName": "bar"
},
"start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"},
"name": "bar"
},
"generator": false,
@@ -65,98 +20,30 @@
"params": [
{
"type": "Identifier",
"start": 13,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "foo"
},
"start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"},
"name": "foo"
}
],
"body": {
"type": "BlockStatement",
"start": 18,
"end": 141,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 9,
"column": 1
}
},
"start":18,"end":141,"loc":{"start":{"line":1,"column":18},"end":{"line":9,"column":1}},
"body": [
{
"type": "SwitchStatement",
"start": 24,
"end": 139,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 8,
"column": 5
}
},
"start":24,"end":139,"loc":{"start":{"line":2,"column":4},"end":{"line":8,"column":5}},
"discriminant": {
"type": "Identifier",
"start": 31,
"end": 34,
"loc": {
"start": {
"line": 2,
"column": 11
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "foo"
},
"start":31,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"},
"name": "foo"
},
"cases": [
{
"type": "SwitchCase",
"start": 61,
"end": 68,
"loc": {
"start": {
"line": 4,
"column": 8
},
"end": {
"line": 4,
"column": 15
}
},
"start":61,"end":68,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":15}},
"consequent": [],
"test": {
"type": "NumericLiteral",
"start": 66,
"end": 67,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 14
}
},
"start":66,"end":67,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":14}},
"extra": {
"rawValue": 1,
"raw": "1"
@@ -167,97 +54,30 @@
{
"type": "CommentLine",
"value": " foo",
"start": 46,
"end": 52,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 14
}
}
"start":46,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}}
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " falls through",
"start": 81,
"end": 97,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 28
}
}
"start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}}
}
]
},
{
"type": "SwitchCase",
"start": 106,
"end": 133,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 7,
"column": 19
}
},
"start":106,"end":133,"loc":{"start":{"line":6,"column":8},"end":{"line":7,"column":19}},
"consequent": [
{
"type": "ExpressionStatement",
"start": 126,
"end": 133,
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 7,
"column": 19
}
},
"start":126,"end":133,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":19}},
"expression": {
"type": "CallExpression",
"start": 126,
"end": 132,
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 7,
"column": 18
}
},
"start":126,"end":132,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":18}},
"callee": {
"type": "Identifier",
"start": 126,
"end": 130,
"loc": {
"start": {
"line": 7,
"column": 12
},
"end": {
"line": 7,
"column": 16
},
"identifierName": "doIt"
},
"start":126,"end":130,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":16},"identifierName":"doIt"},
"name": "doIt"
},
"arguments": []
@@ -266,18 +86,7 @@
],
"test": {
"type": "NumericLiteral",
"start": 111,
"end": 112,
"loc": {
"start": {
"line": 6,
"column": 13
},
"end": {
"line": 6,
"column": 14
}
},
"start":111,"end":112,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":14}},
"extra": {
"rawValue": 2,
"raw": "2"
@@ -288,18 +97,7 @@
{
"type": "CommentLine",
"value": " falls through",
"start": 81,
"end": 97,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 28
}
}
"start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}}
}
]
}
@@ -316,34 +114,12 @@
{
"type": "CommentLine",
"value": " foo",
"start": 46,
"end": 52,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 14
}
}
"start":46,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}}
},
{
"type": "CommentLine",
"value": " falls through",
"start": 81,
"end": 97,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 28
}
}
"start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}}
}
]
}