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

1078 lines
31 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 484,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 0,
"end": 89,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 9,
"end": 89,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 11,
"end": 89,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"value": "C",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 13,
"end": 89,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 19,
"end": 87,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 26,
"end": 87,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 36,
"end": 41,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 42,
"end": 87,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 52,
"end": 62,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 61,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 71,
"end": 81,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 71,
"end": 72,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 72,
"end": 80,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 74,
"end": 80,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 91,
"end": 217,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 100,
"end": 217,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 106,
"end": 215,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 113,
"end": 215,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 122,
"end": 215,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 132,
"end": 168,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 136,
"end": 167,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 136,
"end": 141,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 141,
"end": 150,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 143,
"end": 150,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "C",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 153,
"end": 167,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": 0.0
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 164,
"end": 165,
"ctxt": 0
},
"value": 0.0
}
}
]
},
"definite": false
}
]
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 219,
"end": 299,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 229,
"end": 299,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 231,
"end": 299,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 237,
"end": 297,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 244,
"end": 297,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 254,
"end": 259,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 260,
"end": 297,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 270,
"end": 280,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 270,
"end": 271,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 271,
"end": 279,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 273,
"end": 279,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 281,
"end": 291,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 282,
"end": 290,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 284,
"end": 290,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 301,
"end": 376,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 308,
"end": 310,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 311,
"end": 376,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 317,
"end": 374,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 324,
"end": 374,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 333,
"end": 374,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 343,
"end": 368,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 350,
"end": 368,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 354,
"end": 367,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 354,
"end": 359,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 359,
"end": 367,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 361,
"end": 367,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 378,
"end": 391,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 382,
"end": 390,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "m",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 386,
"end": 390,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 386,
"end": 388,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "X",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 392,
"end": 410,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 396,
"end": 409,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 396,
"end": 401,
"ctxt": 0
},
"value": "point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 401,
"end": 409,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 403,
"end": 409,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 411,
"end": 431,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 415,
"end": 430,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 415,
"end": 420,
"ctxt": 0
},
"value": "point",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 423,
"end": 430,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 423,
"end": 424,
"ctxt": 0
},
"value": "m",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 425,
"end": 430,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 433,
"end": 465,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 437,
"end": 465,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 437,
"end": 438,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 438,
"end": 465,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 440,
"end": 465,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 442,
"end": 452,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 442,
"end": 443,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 443,
"end": 451,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 445,
"end": 451,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 453,
"end": 463,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 453,
"end": 454,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 454,
"end": 462,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 456,
"end": 462,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 466,
"end": 484,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 470,
"end": 483,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 471,
"end": 483,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 473,
"end": 483,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 473,
"end": 475,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 476,
"end": 477,
"ctxt": 0
},
"value": "X",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 478,
"end": 483,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
}
],
"interpreter": null
}