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

1080 lines
31 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 485,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 1,
"end": 90,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 8,
"end": 9,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 10,
"end": 90,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 12,
"end": 90,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"value": "C",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 14,
"end": 90,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 20,
"end": 88,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 27,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 37,
"end": 42,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 43,
"end": 88,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 53,
"end": 63,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 54,
"end": 62,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 72,
"end": 82,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 73,
"end": 81,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 75,
"end": 81,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 92,
"end": 218,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "A",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 101,
"end": 218,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 107,
"end": 216,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 114,
"end": 216,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 121,
"end": 122,
"ctxt": 0
},
"value": "B",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 123,
"end": 216,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 133,
"end": 169,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 137,
"end": 168,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 144,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 144,
"end": 145,
"ctxt": 0
},
"value": "C",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
},
"init": {
"type": "ObjectExpression",
"span": {
"start": 154,
"end": 168,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "y",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"definite": false
}
]
}
]
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 220,
"end": 300,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 227,
"end": 229,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 230,
"end": 300,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 232,
"end": 300,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 238,
"end": 298,
"ctxt": 0
},
"declaration": {
"type": "TsInterfaceDeclaration",
"span": {
"start": 245,
"end": 298,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 255,
"end": 260,
"ctxt": 0
},
"value": "Point",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 261,
"end": 298,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 271,
"end": 281,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 271,
"end": 272,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 272,
"end": 280,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 274,
"end": 280,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 282,
"end": 292,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 283,
"end": 291,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 285,
"end": 291,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
]
}
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 302,
"end": 377,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 309,
"end": 311,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 312,
"end": 377,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 318,
"end": 375,
"ctxt": 0
},
"declaration": {
"type": "TsModuleDeclaration",
"span": {
"start": 325,
"end": 375,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 332,
"end": 333,
"ctxt": 0
},
"value": "X",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 334,
"end": 375,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 344,
"end": 369,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 351,
"end": 369,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 355,
"end": 368,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 355,
"end": 360,
"ctxt": 0
},
"value": "Point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 360,
"end": 368,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 362,
"end": 368,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 379,
"end": 392,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 383,
"end": 391,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "m",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 387,
"end": 391,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 387,
"end": 389,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 390,
"end": 391,
"ctxt": 0
},
"value": "X",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 393,
"end": 411,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 397,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 397,
"end": 402,
"ctxt": 0
},
"value": "point",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 402,
"end": 410,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 404,
"end": 410,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 412,
"end": 432,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 416,
"end": 431,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 416,
"end": 421,
"ctxt": 0
},
"value": "point",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 424,
"end": 431,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "m",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 426,
"end": 431,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 434,
"end": 466,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 438,
"end": 466,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 438,
"end": 439,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 439,
"end": 466,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 441,
"end": 466,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 443,
"end": 453,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": "x",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 444,
"end": 452,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 446,
"end": 452,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
"start": 454,
"end": 464,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 454,
"end": 455,
"ctxt": 0
},
"value": "y",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 455,
"end": 463,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 457,
"end": 463,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 467,
"end": 485,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 471,
"end": 484,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 471,
"end": 472,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 472,
"end": 484,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 474,
"end": 484,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 474,
"end": 476,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"value": "X",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 479,
"end": 484,
"ctxt": 0
},
"value": "Point",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
}
],
"interpreter": null
}