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

1019 lines
26 KiB
JSON

{
"type": "Module",
"span": {
"start": 39,
"end": 496,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 39,
"end": 87,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 54,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 46,
"end": 87,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 58,
"end": 66,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 58,
"end": 60,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 63,
"end": 65,
"ctxt": 0
},
"value": 42.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 68,
"end": 85,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 75,
"end": 77,
"ctxt": 0
},
"value": "s1",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 80,
"end": 84,
"ctxt": 0
},
"value": true
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 89,
"end": 141,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 96,
"end": 141,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 106,
"end": 108,
"ctxt": 0
},
"value": "I1",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 109,
"end": 141,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 112,
"end": 125,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 112,
"end": 116,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 116,
"end": 124,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 118,
"end": 124,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 127,
"end": 139,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 127,
"end": 130,
"ctxt": 0
},
"value": "age",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 130,
"end": 138,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 132,
"end": 138,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 143,
"end": 204,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 150,
"end": 204,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 157,
"end": 159,
"ctxt": 0
},
"value": "M1",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 160,
"end": 204,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 163,
"end": 202,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 170,
"end": 202,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 180,
"end": 182,
"ctxt": 0
},
"value": "I2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 183,
"end": 202,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 187,
"end": 199,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 190,
"end": 198,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 192,
"end": 198,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 206,
"end": 231,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 213,
"end": 231,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 218,
"end": 220,
"ctxt": 0
},
"value": "E1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 256,
"end": 288,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 263,
"end": 266,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 269,
"end": 287,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 277,
"end": 286,
"ctxt": 0
},
"value": "./foo_0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 353,
"end": 371,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "f",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 364,
"end": 367,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 368,
"end": 370,
"ctxt": 0
},
"value": "M1",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 372,
"end": 384,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 376,
"end": 383,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 377,
"end": 383,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 379,
"end": 383,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": "f",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 381,
"end": 383,
"ctxt": 0
},
"value": "I2",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 385,
"end": 418,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 389,
"end": 417,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 390,
"end": 398,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 392,
"end": 398,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 392,
"end": 395,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 396,
"end": 398,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"typeParams": null
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 401,
"end": 417,
"ctxt": 0
},
"expression": {
"type": "ObjectExpression",
"span": {
"start": 415,
"end": 417,
"ctxt": 0
},
"properties": []
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 402,
"end": 414,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 403,
"end": 413,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 403,
"end": 405,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 405,
"end": 413,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 407,
"end": 413,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 419,
"end": 451,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 423,
"end": 450,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 424,
"end": 442,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 426,
"end": 442,
"ctxt": 0
},
"exprName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 433,
"end": 436,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 437,
"end": 439,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 440,
"end": 442,
"ctxt": 0
},
"value": "s1",
"optional": false
}
}
}
}
},
"init": {
"type": "BooleanLiteral",
"span": {
"start": 445,
"end": 450,
"ctxt": 0
},
"value": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 452,
"end": 469,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 456,
"end": 468,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 457,
"end": 468,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 459,
"end": 468,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 459,
"end": 462,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 463,
"end": 465,
"ctxt": 0
},
"value": "M1",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 466,
"end": 468,
"ctxt": 0
},
"value": "I2",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 470,
"end": 496,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 474,
"end": 495,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 474,
"end": 475,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 475,
"end": 483,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 477,
"end": 483,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 486,
"end": 495,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": 0.0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 487,
"end": 493,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 487,
"end": 490,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 491,
"end": 493,
"ctxt": 0
},
"value": "E1",
"optional": false
}
},
"typeParams": null
}
},
"definite": false
}
]
}
],
"interpreter": null
}