swc/crates/swc_ecma_parser/tests/tsc/parserRegularExpression4.json

907 lines
30 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 298,
"ctxt": 0
},
"body": [
{
"type": "IfStatement",
"span": {
"start": 1,
"end": 298,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 5,
"end": 100,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "CallExpression",
"span": {
"start": 5,
"end": 20,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 5,
"end": 12,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 5,
"end": 7,
"ctxt": 0
},
"value": "Ca",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 8,
"end": 12,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 13,
"end": 19,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 15,
"end": 19,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 24,
"end": 100,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "BinaryExpression",
"span": {
"start": 24,
"end": 71,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "CallExpression",
"span": {
"start": 24,
"end": 39,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 24,
"end": 31,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 24,
"end": 26,
"ctxt": 0
},
"value": "Ba",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 27,
"end": 31,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 32,
"end": 38,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 32,
"end": 33,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 34,
"end": 38,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 43,
"end": 71,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 43,
"end": 63,
"ctxt": 0
},
"object": {
"type": "RegExpLiteral",
"span": {
"start": 43,
"end": 58,
"ctxt": 0
},
"pattern": "(\\\\?|&)adurl=",
"flags": ""
},
"property": {
"type": "Identifier",
"span": {
"start": 59,
"end": 63,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 66,
"end": 70,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
}
},
"right": {
"type": "UnaryExpression",
"span": {
"start": 75,
"end": 100,
"ctxt": 0
},
"operator": "!",
"argument": {
"type": "CallExpression",
"span": {
"start": 76,
"end": 100,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 76,
"end": 92,
"ctxt": 0
},
"object": {
"type": "RegExpLiteral",
"span": {
"start": 76,
"end": 87,
"ctxt": 0
},
"pattern": "(\\\\?|&)q=",
"flags": ""
},
"property": {
"type": "Identifier",
"span": {
"start": 88,
"end": 92,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 95,
"end": 99,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
}
}
}
},
"consequent": {
"type": "ExpressionStatement",
"span": {
"start": 102,
"end": 298,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 102,
"end": 297,
"ctxt": 0
},
"expressions": [
{
"type": "BinaryExpression",
"span": {
"start": 102,
"end": 158,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "CallExpression",
"span": {
"start": 102,
"end": 139,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 102,
"end": 131,
"ctxt": 0
},
"object": {
"type": "RegExpLiteral",
"span": {
"start": 102,
"end": 125,
"ctxt": 0
},
"pattern": " (\\\\ ? | & ) rct = j ",
"flags": ""
},
"property": {
"type": "Identifier",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 132,
"end": 138,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 132,
"end": 133,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 134,
"end": 138,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
},
"right": {
"type": "ParenthesisExpression",
"span": {
"start": 143,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 144,
"end": 157,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 149,
"end": 157,
"ctxt": 0
},
"value": "&rct=j",
"raw": "\"&rct=j\""
}
}
}
},
{
"type": "BinaryExpression",
"span": {
"start": 160,
"end": 289,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "CallExpression",
"span": {
"start": 160,
"end": 184,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 160,
"end": 176,
"ctxt": 0
},
"object": {
"type": "RegExpLiteral",
"span": {
"start": 160,
"end": 171,
"ctxt": 0
},
"pattern": "(\\\\?|&)q=",
"flags": ""
},
"property": {
"type": "Identifier",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"value": "test",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 177,
"end": 183,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
},
"value": "href",
"optional": false
}
}
}
],
"typeArguments": null
},
"right": {
"type": "ParenthesisExpression",
"span": {
"start": 188,
"end": 289,
"ctxt": 0
},
"expression": {
"type": "SequenceExpression",
"span": {
"start": 189,
"end": 288,
"ctxt": 0
},
"expressions": [
{
"type": "AssignmentExpression",
"span": {
"start": 189,
"end": 246,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 194,
"end": 246,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 194,
"end": 199,
"ctxt": 0
},
"value": "&q=",
"raw": "\"&q=\""
},
"right": {
"type": "CallExpression",
"span": {
"start": 202,
"end": 246,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 202,
"end": 220,
"ctxt": 0
},
"value": "encodeURIComponent",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 221,
"end": 245,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "BinaryExpression",
"span": {
"start": 221,
"end": 240,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "CallExpression",
"span": {
"start": 221,
"end": 227,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "W",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 223,
"end": 226,
"ctxt": 0
},
"value": "q",
"raw": "\"q\""
}
}
],
"typeArguments": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 231,
"end": 240,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 231,
"end": 232,
"ctxt": 0
},
"value": "W",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 233,
"end": 239,
"ctxt": 0
},
"value": "as_q",
"raw": "\"as_q\""
}
}
],
"typeArguments": null
}
},
"right": {
"type": "Identifier",
"span": {
"start": 244,
"end": 245,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
}
],
"typeArguments": null
}
}
},
{
"type": "AssignmentExpression",
"span": {
"start": 248,
"end": 288,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "CallExpression",
"span": {
"start": 252,
"end": 288,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 252,
"end": 263,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 252,
"end": 253,
"ctxt": 0
},
"value": "d",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 254,
"end": 263,
"ctxt": 0
},
"value": "substring",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 267,
"end": 287,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "NumericLiteral",
"span": {
"start": 267,
"end": 271,
"ctxt": 0
},
"value": 1948.0,
"raw": "1948"
},
"right": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 287,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 274,
"end": 280,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 274,
"end": 275,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 276,
"end": 280,
"ctxt": 0
},
"value": "href",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 281,
"end": 287,
"ctxt": 0
},
"value": "length",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
}
}
},
{
"type": "AssignmentExpression",
"span": {
"start": 291,
"end": 297,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "UnaryExpression",
"span": {
"start": 295,
"end": 297,
"ctxt": 0
},
"operator": "!",
"argument": {
"type": "NumericLiteral",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
}
]
}
},
"alternate": null
}
],
"interpreter": null
}