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

790 lines
19 KiB
JSON

{
"type": "Script",
"span": {
"start": 19,
"end": 462,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 19,
"end": 37,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 23,
"end": 36,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 23,
"end": 25,
"ctxt": 0
},
"value": "e1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 25,
"end": 36,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 27,
"end": 36,
"ctxt": 0
},
"kind": "intrinsic"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 38,
"end": 71,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 42,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"value": "e2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 44,
"end": 70,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 46,
"end": 70,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 48,
"end": 68,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 48,
"end": 57,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 57,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 59,
"end": 68,
"ctxt": 0
},
"kind": "intrinsic"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 72,
"end": 95,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": "TE1",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsParenthesizedType",
"span": {
"start": 83,
"end": 94,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 84,
"end": 93,
"ctxt": 0
},
"kind": "intrinsic"
}
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 96,
"end": 128,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 101,
"end": 104,
"ctxt": 0
},
"value": "TE2",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 104,
"end": 115,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 105,
"end": 114,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 105,
"end": 114,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"in": false,
"out": false,
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 118,
"end": 127,
"ctxt": 0
},
"kind": "intrinsic"
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 129,
"end": 163,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"value": "TE3",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 137,
"end": 158,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 138,
"end": 157,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 148,
"end": 157,
"ctxt": 0
},
"kind": "intrinsic"
},
"default": null
}
]
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 164,
"end": 214,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 169,
"end": 172,
"ctxt": 0
},
"value": "TE4",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 172,
"end": 201,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 173,
"end": 200,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 173,
"end": 182,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 191,
"end": 200,
"ctxt": 0
},
"kind": "intrinsic"
},
"default": null
}
]
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 204,
"end": 213,
"ctxt": 0
},
"kind": "intrinsic"
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 215,
"end": 267,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"value": "TE5",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 223,
"end": 252,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 224,
"end": 251,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"in": false,
"out": false,
"constraint": {
"type": "TsKeywordType",
"span": {
"start": 242,
"end": 251,
"ctxt": 0
},
"kind": "intrinsic"
},
"default": null
}
]
},
"typeAnnotation": {
"type": "TsParenthesizedType",
"span": {
"start": 255,
"end": 266,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 256,
"end": 265,
"ctxt": 0
},
"kind": "intrinsic"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 278,
"end": 280,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 269,
"end": 326,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 283,
"end": 326,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 289,
"end": 324,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 293,
"end": 323,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 293,
"end": 302,
"ctxt": 0
},
"value": "intrinsic",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 302,
"end": 323,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 304,
"end": 323,
"ctxt": 0
},
"typeName": {
"type": "TsQualifiedName",
"left": {
"type": "Identifier",
"span": {
"start": 304,
"end": 313,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 314,
"end": 323,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
}
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 337,
"end": 339,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 340,
"end": 357,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 340,
"end": 357,
"ctxt": 0
},
"value": "intrinsic",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 349,
"end": 357,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 351,
"end": 357,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 328,
"end": 384,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 359,
"end": 384,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 365,
"end": 382,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 372,
"end": 381,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 386,
"end": 462,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 400,
"end": 462,
"ctxt": 0
},
"stmts": [
{
"type": "TsTypeAliasDeclaration",
"span": {
"start": 406,
"end": 430,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
"start": 411,
"end": 420,
"ctxt": 0
},
"value": "intrinsic",
"optional": false
},
"typeParams": null,
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 423,
"end": 429,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 435,
"end": 460,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 439,
"end": 459,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 439,
"end": 441,
"ctxt": 0
},
"value": "s1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 441,
"end": 452,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 443,
"end": 452,
"ctxt": 0
},
"kind": "intrinsic"
}
}
},
"init": {
"type": "StringLiteral",
"span": {
"start": 455,
"end": 459,
"ctxt": 0
},
"value": "ok",
"raw": "'ok'"
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}