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

698 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 32,
"end": 582,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 32,
"end": 102,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 47,
"end": 56,
"ctxt": 0
},
"value": "foo*baz",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 57,
"end": 102,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 63,
"end": 100,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 79,
"end": 82,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 83,
"end": 92,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 83,
"end": 92,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 84,
"end": 92,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 70,
"end": 100,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 93,
"end": 99,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 95,
"end": 99,
"ctxt": 0
},
"kind": "void"
}
}
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 131,
"end": 189,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 146,
"end": 155,
"ctxt": 0
},
"value": "foo*baz",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 156,
"end": 189,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 162,
"end": 187,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 169,
"end": 187,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 175,
"end": 186,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"value": "baz",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 178,
"end": 186,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 180,
"end": 186,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 214,
"end": 271,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 229,
"end": 236,
"ctxt": 0
},
"value": "foos*",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 237,
"end": 271,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 243,
"end": 269,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 250,
"end": 269,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 256,
"end": 268,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 256,
"end": 260,
"ctxt": 0
},
"value": "foos",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 260,
"end": 268,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 262,
"end": 268,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
}
}
]
}
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 273,
"end": 343,
"ctxt": 0
},
"declare": true,
"global": false,
"id": {
"type": "StringLiteral",
"span": {
"start": 288,
"end": 296,
"ctxt": 0
},
"value": "*!text",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 297,
"end": 343,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 303,
"end": 319,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 309,
"end": 318,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 309,
"end": 310,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 310,
"end": 318,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 312,
"end": 318,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExportDefaultExpression",
"span": {
"start": 324,
"end": 341,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
]
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 409,
"end": 444,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 417,
"end": 420,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"imported": null,
"isTypeOnly": false
},
{
"type": "ImportSpecifier",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"value": "baz",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 432,
"end": 443,
"ctxt": 0
},
"value": "foobarbaz",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 445,
"end": 454,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 445,
"end": 453,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 445,
"end": 448,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 449,
"end": 452,
"ctxt": 0
},
"value": "baz",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 456,
"end": 486,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportSpecifier",
"span": {
"start": 464,
"end": 468,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 464,
"end": 468,
"ctxt": 0
},
"value": "foos",
"optional": false
},
"imported": null,
"isTypeOnly": false
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 475,
"end": 485,
"ctxt": 0
},
"value": "foosball",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 487,
"end": 497,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 487,
"end": 496,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 487,
"end": 490,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 491,
"end": 495,
"ctxt": 0
},
"value": "foos",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ImportDeclaration",
"span": {
"start": 532,
"end": 567,
"ctxt": 0
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"span": {
"start": 539,
"end": 547,
"ctxt": 0
},
"local": {
"type": "Identifier",
"span": {
"start": 539,
"end": 547,
"ctxt": 0
},
"value": "fileText",
"optional": false
}
}
],
"source": {
"type": "StringLiteral",
"span": {
"start": 553,
"end": 566,
"ctxt": 0
},
"value": "./file!text",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeOnly": false,
"asserts": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 568,
"end": 582,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 568,
"end": 581,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 568,
"end": 571,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 572,
"end": 580,
"ctxt": 0
},
"value": "fileText",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}