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

1018 lines
26 KiB
JSON

{
"type": "Module",
"span": {
"start": 40,
"end": 497,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 40,
"end": 88,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 53,
"end": 55,
"ctxt": 0
},
"value": "C1",
"optional": false
},
"declare": false,
"span": {
"start": 47,
"end": 88,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 59,
"end": 67,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 59,
"end": 61,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 64,
"end": 66,
"ctxt": 0
},
"value": 42.0,
"raw": "42"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 69,
"end": 86,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": "s1",
"optional": false
},
"value": {
"type": "BooleanLiteral",
"span": {
"start": 81,
"end": 85,
"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": 90,
"end": 142,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 97,
"end": 142,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 107,
"end": 109,
"ctxt": 0
},
"value": "I1",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 110,
"end": 142,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 113,
"end": 126,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"value": "name",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 117,
"end": 125,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 119,
"end": 125,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 128,
"end": 140,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"value": "age",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 131,
"end": 139,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 133,
"end": 139,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 144,
"end": 205,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 151,
"end": 205,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 160,
"ctxt": 0
},
"value": "M1",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 161,
"end": 205,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 164,
"end": 203,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 171,
"end": 203,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 181,
"end": 183,
"ctxt": 0
},
"value": "I2",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 184,
"end": 203,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 188,
"end": 200,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 188,
"end": 191,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 191,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 207,
"end": 232,
"ctxt": 0
},
"declaration": {
"type": "TsEnumDeclaration",
"span": {
"start": 214,
"end": 232,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 221,
"ctxt": 0
},
"value": "E1",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "A",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "B",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "C",
"optional": false
},
"init": null
}
]
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 257,
"end": 289,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"moduleRef": {
"type": "TsExternalModuleReference",
"span": {
"start": 270,
"end": 288,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 278,
"end": 287,
"ctxt": 0
},
"value": "./foo_0",
"raw": "\"./foo_0\""
}
}
},
{
"type": "TsImportEqualsDeclaration",
"span": {
"start": 354,
"end": 372,
"ctxt": 0
},
"declare": false,
"isExport": false,
"isTypeOnly": false,
"id": {
"type": "Identifier",
"span": {
"start": 361,
"end": 362,
"ctxt": 0
},
"value": "f",
"optional": false
},
"moduleRef": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 365,
"end": 368,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 369,
"end": 371,
"ctxt": 0
},
"value": "M1",
"optional": false
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 373,
"end": 385,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 377,
"end": 384,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 378,
"end": 384,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 380,
"end": 384,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 380,
"end": 381,
"ctxt": 0
},
"value": "f",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 382,
"end": 384,
"ctxt": 0
},
"value": "I2",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 386,
"end": 419,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 390,
"end": 418,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 391,
"end": 399,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 393,
"end": 399,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 393,
"end": 396,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 397,
"end": 399,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"typeParams": null
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 402,
"end": 418,
"ctxt": 0
},
"expression": {
"type": "ObjectExpression",
"span": {
"start": 416,
"end": 418,
"ctxt": 0
},
"properties": []
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 403,
"end": 415,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 404,
"end": 414,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 404,
"end": 406,
"ctxt": 0
},
"value": "m1",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 406,
"end": 414,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 408,
"end": 414,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 420,
"end": 452,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 424,
"end": 451,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 425,
"end": 443,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 427,
"end": 443,
"ctxt": 0
},
"exprName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 434,
"end": 437,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 438,
"end": 440,
"ctxt": 0
},
"value": "C1",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 441,
"end": 443,
"ctxt": 0
},
"value": "s1",
"optional": false
}
},
"typeArguments": null
}
}
},
"init": {
"type": "BooleanLiteral",
"span": {
"start": 446,
"end": 451,
"ctxt": 0
},
"value": false
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 453,
"end": 470,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 457,
"end": 469,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 457,
"end": 458,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 458,
"end": 469,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 460,
"end": 469,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 464,
"end": 466,
"ctxt": 0
},
"value": "M1",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 467,
"end": 469,
"ctxt": 0
},
"value": "I2",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 471,
"end": 497,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 475,
"end": 496,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "e",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 476,
"end": 484,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 478,
"end": 484,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 487,
"end": 496,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 488,
"end": 494,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 488,
"end": 491,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 492,
"end": 494,
"ctxt": 0
},
"value": "E1",
"optional": false
}
},
"typeParams": null
}
},
"definite": false
}
]
}
],
"interpreter": null
}