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

2446 lines
93 KiB
JSON

{
"type": "Script",
"span": {
"start": 212,
"end": 1877,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 212,
"end": 1877,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 219,
"end": 229,
"ctxt": 0
},
"value": "TypeScript",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 230,
"end": 1877,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 287,
"end": 1465,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 300,
"end": 312,
"ctxt": 0
},
"value": "PrintContext",
"optional": false
},
"declare": false,
"span": {
"start": 294,
"end": 1465,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 323,
"end": 343,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 330,
"end": 337,
"ctxt": 0
},
"value": "builder",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 340,
"end": 342,
"ctxt": 0
},
"value": "",
"raw": "\"\""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 352,
"end": 374,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 359,
"end": 366,
"ctxt": 0
},
"value": "indent1",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 369,
"end": 373,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 383,
"end": 419,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 390,
"end": 403,
"ctxt": 0
},
"value": "indentStrings",
"optional": false
},
"value": {
"type": "ArrayExpression",
"span": {
"start": 416,
"end": 418,
"ctxt": 0
},
"elements": []
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 403,
"end": 413,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 405,
"end": 413,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 405,
"end": 411,
"ctxt": 0
},
"kind": "string"
}
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 428,
"end": 449,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 435,
"end": 444,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 459,
"end": 535,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 459,
"end": 470,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 472,
"end": 499,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 479,
"end": 499,
"ctxt": 0
},
"value": "outfile",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 486,
"end": 499,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 488,
"end": 499,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 488,
"end": 499,
"ctxt": 0
},
"value": "ITextWriter",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "TsParameterProperty",
"span": {
"start": 501,
"end": 522,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 508,
"end": 522,
"ctxt": 0
},
"value": "parser",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 514,
"end": 522,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 516,
"end": 522,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 516,
"end": 522,
"ctxt": 0
},
"value": "Parser",
"optional": false
},
"typeParams": null
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 524,
"end": 535,
"ctxt": 0
},
"stmts": []
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassMethod",
"span": {
"start": 545,
"end": 610,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 552,
"end": 566,
"ctxt": 0
},
"value": "increaseIndent",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 545,
"end": 610,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 569,
"end": 610,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 583,
"end": 600,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 583,
"end": 599,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "MemberExpression",
"span": {
"start": 583,
"end": 597,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 583,
"end": 587,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 588,
"end": 597,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 620,
"end": 685,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 627,
"end": 641,
"ctxt": 0
},
"value": "decreaseIndent",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 620,
"end": 685,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 644,
"end": 685,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 658,
"end": 675,
"ctxt": 0
},
"expression": {
"type": "UpdateExpression",
"span": {
"start": 658,
"end": 674,
"ctxt": 0
},
"operator": "--",
"prefix": false,
"argument": {
"type": "MemberExpression",
"span": {
"start": 658,
"end": 672,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 658,
"end": 662,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 663,
"end": 672,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 695,
"end": 1237,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 702,
"end": 711,
"ctxt": 0
},
"value": "startLine",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 695,
"end": 1237,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 714,
"end": 1237,
"ctxt": 0
},
"stmts": [
{
"type": "IfStatement",
"span": {
"start": 728,
"end": 829,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 732,
"end": 755,
"ctxt": 0
},
"operator": ">",
"left": {
"type": "MemberExpression",
"span": {
"start": 732,
"end": 751,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 732,
"end": 744,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 732,
"end": 736,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 737,
"end": 744,
"ctxt": 0
},
"value": "builder",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 745,
"end": 751,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 754,
"end": 755,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 757,
"end": 829,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 775,
"end": 815,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 775,
"end": 814,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 775,
"end": 800,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 775,
"end": 794,
"ctxt": 0
},
"value": "CompilerDiagnostics",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 795,
"end": 800,
"ctxt": 0
},
"value": "Alert",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 801,
"end": 813,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 801,
"end": 805,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 806,
"end": 813,
"ctxt": 0
},
"value": "builder",
"optional": false
}
}
}
],
"typeArguments": null
}
}
]
},
"alternate": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 842,
"end": 896,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 846,
"end": 895,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 846,
"end": 858,
"ctxt": 0
},
"value": "indentString",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 861,
"end": 895,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 861,
"end": 879,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 861,
"end": 865,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 866,
"end": 879,
"ctxt": 0
},
"value": "indentStrings",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 879,
"end": 895,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 880,
"end": 894,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 880,
"end": 884,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 885,
"end": 894,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "IfStatement",
"span": {
"start": 909,
"end": 1185,
"ctxt": 0
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 913,
"end": 939,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "Identifier",
"span": {
"start": 913,
"end": 925,
"ctxt": 0
},
"value": "indentString",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 930,
"end": 939,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"consequent": {
"type": "BlockStatement",
"span": {
"start": 941,
"end": 1185,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 959,
"end": 977,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 959,
"end": 976,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 959,
"end": 971,
"ctxt": 0
},
"value": "indentString",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 974,
"end": 976,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "ForStatement",
"span": {
"start": 994,
"end": 1104,
"ctxt": 0
},
"init": {
"type": "VariableDeclaration",
"span": {
"start": 999,
"end": 1008,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1003,
"end": 1008,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1003,
"end": 1004,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NumericLiteral",
"span": {
"start": 1007,
"end": 1008,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
},
"definite": false
}
]
},
"test": {
"type": "BinaryExpression",
"span": {
"start": 1010,
"end": 1028,
"ctxt": 0
},
"operator": "<",
"left": {
"type": "Identifier",
"span": {
"start": 1010,
"end": 1011,
"ctxt": 0
},
"value": "i",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 1014,
"end": 1028,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1014,
"end": 1018,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1019,
"end": 1028,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
}
}
},
"update": {
"type": "UpdateExpression",
"span": {
"start": 1030,
"end": 1033,
"ctxt": 0
},
"operator": "++",
"prefix": false,
"argument": {
"type": "Identifier",
"span": {
"start": 1030,
"end": 1031,
"ctxt": 0
},
"value": "i",
"optional": false
}
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1035,
"end": 1104,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1057,
"end": 1086,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1057,
"end": 1085,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "Identifier",
"span": {
"start": 1057,
"end": 1069,
"ctxt": 0
},
"value": "indentString",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "MemberExpression",
"span": {
"start": 1073,
"end": 1085,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1073,
"end": 1077,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1078,
"end": 1085,
"ctxt": 0
},
"value": "indent1",
"optional": false
}
}
}
}
]
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1121,
"end": 1171,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1121,
"end": 1170,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1121,
"end": 1155,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 1121,
"end": 1139,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1121,
"end": 1125,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1126,
"end": 1139,
"ctxt": 0
},
"value": "indentStrings",
"optional": false
}
},
"property": {
"type": "Computed",
"span": {
"start": 1139,
"end": 1155,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1140,
"end": 1154,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1140,
"end": 1144,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1145,
"end": 1154,
"ctxt": 0
},
"value": "indentAmt",
"optional": false
}
}
}
},
"right": {
"type": "Identifier",
"span": {
"start": 1158,
"end": 1170,
"ctxt": 0
},
"value": "indentString",
"optional": false
}
}
}
]
},
"alternate": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 1198,
"end": 1227,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1198,
"end": 1226,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1198,
"end": 1210,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1198,
"end": 1202,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1203,
"end": 1210,
"ctxt": 0
},
"value": "builder",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 1214,
"end": 1226,
"ctxt": 0
},
"value": "indentString",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 1247,
"end": 1305,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1254,
"end": 1259,
"ctxt": 0
},
"value": "write",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 1260,
"end": 1261,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1260,
"end": 1261,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 1247,
"end": 1305,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1263,
"end": 1305,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1277,
"end": 1295,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1277,
"end": 1294,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1277,
"end": 1289,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1277,
"end": 1281,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1282,
"end": 1289,
"ctxt": 0
},
"value": "builder",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 1293,
"end": 1294,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 1315,
"end": 1458,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1322,
"end": 1331,
"ctxt": 0
},
"value": "writeLine",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 1332,
"end": 1333,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1332,
"end": 1333,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 1315,
"end": 1458,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1335,
"end": 1458,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1349,
"end": 1367,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1349,
"end": 1366,
"ctxt": 0
},
"operator": "+=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1349,
"end": 1361,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1349,
"end": 1353,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1354,
"end": 1361,
"ctxt": 0
},
"value": "builder",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 1365,
"end": 1366,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1380,
"end": 1417,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1380,
"end": 1416,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1380,
"end": 1402,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 1380,
"end": 1392,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1380,
"end": 1384,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1385,
"end": 1392,
"ctxt": 0
},
"value": "outfile",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1393,
"end": 1402,
"ctxt": 0
},
"value": "WriteLine",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 1403,
"end": 1415,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1403,
"end": 1407,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1408,
"end": 1415,
"ctxt": 0
},
"value": "builder",
"optional": false
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1430,
"end": 1448,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 1430,
"end": 1447,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 1430,
"end": 1442,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 1430,
"end": 1434,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 1435,
"end": 1442,
"ctxt": 0
},
"value": "builder",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 1445,
"end": 1447,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1471,
"end": 1681,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1487,
"end": 1498,
"ctxt": 0
},
"value": "prePrintAST",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1499,
"end": 1507,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1499,
"end": 1507,
"ctxt": 0
},
"value": "ast",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1502,
"end": 1507,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1504,
"end": 1507,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1504,
"end": 1507,
"ctxt": 0
},
"value": "AST",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 1509,
"end": 1520,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1509,
"end": 1520,
"ctxt": 0
},
"value": "parent",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1515,
"end": 1520,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1517,
"end": 1520,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1517,
"end": 1520,
"ctxt": 0
},
"value": "AST",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 1522,
"end": 1540,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1522,
"end": 1540,
"ctxt": 0
},
"value": "walker",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1528,
"end": 1540,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1530,
"end": 1540,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1530,
"end": 1540,
"ctxt": 0
},
"value": "IAstWalker",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 1478,
"end": 1681,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1542,
"end": 1681,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1552,
"end": 1602,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1556,
"end": 1601,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1556,
"end": 1558,
"ctxt": 0
},
"value": "pc",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1558,
"end": 1572,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1560,
"end": 1572,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1560,
"end": 1572,
"ctxt": 0
},
"value": "PrintContext",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 1575,
"end": 1601,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1589,
"end": 1601,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1589,
"end": 1595,
"ctxt": 0
},
"value": "walker",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1596,
"end": 1601,
"ctxt": 0
},
"value": "state",
"optional": false
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1576,
"end": 1588,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1576,
"end": 1588,
"ctxt": 0
},
"value": "PrintContext",
"optional": false
},
"typeParams": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1612,
"end": 1626,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1612,
"end": 1625,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1612,
"end": 1621,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1612,
"end": 1615,
"ctxt": 0
},
"value": "ast",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1616,
"end": 1621,
"ctxt": 0
},
"value": "print",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 1622,
"end": 1624,
"ctxt": 0
},
"value": "pc",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1635,
"end": 1655,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1635,
"end": 1654,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1635,
"end": 1652,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1635,
"end": 1637,
"ctxt": 0
},
"value": "pc",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1638,
"end": 1652,
"ctxt": 0
},
"value": "increaseIndent",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ReturnStatement",
"span": {
"start": 1664,
"end": 1675,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 1671,
"end": 1674,
"ctxt": 0
},
"value": "ast",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 1688,
"end": 1875,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1704,
"end": 1716,
"ctxt": 0
},
"value": "postPrintAST",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 1717,
"end": 1725,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1717,
"end": 1725,
"ctxt": 0
},
"value": "ast",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1720,
"end": 1725,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1722,
"end": 1725,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1722,
"end": 1725,
"ctxt": 0
},
"value": "AST",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 1727,
"end": 1738,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1727,
"end": 1738,
"ctxt": 0
},
"value": "parent",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1733,
"end": 1738,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1735,
"end": 1738,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1735,
"end": 1738,
"ctxt": 0
},
"value": "AST",
"optional": false
},
"typeParams": null
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 1740,
"end": 1758,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 1740,
"end": 1758,
"ctxt": 0
},
"value": "walker",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1746,
"end": 1758,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1748,
"end": 1758,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1748,
"end": 1758,
"ctxt": 0
},
"value": "IAstWalker",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 1695,
"end": 1875,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1760,
"end": 1875,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 1770,
"end": 1820,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 1774,
"end": 1819,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 1774,
"end": 1776,
"ctxt": 0
},
"value": "pc",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1776,
"end": 1790,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1778,
"end": 1790,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1778,
"end": 1790,
"ctxt": 0
},
"value": "PrintContext",
"optional": false
},
"typeParams": null
}
}
},
"init": {
"type": "TsTypeAssertion",
"span": {
"start": 1793,
"end": 1819,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1807,
"end": 1819,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1807,
"end": 1813,
"ctxt": 0
},
"value": "walker",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1814,
"end": 1819,
"ctxt": 0
},
"value": "state",
"optional": false
}
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 1794,
"end": 1806,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 1794,
"end": 1806,
"ctxt": 0
},
"value": "PrintContext",
"optional": false
},
"typeParams": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 1829,
"end": 1849,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 1829,
"end": 1848,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 1829,
"end": 1846,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1829,
"end": 1831,
"ctxt": 0
},
"value": "pc",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1832,
"end": 1846,
"ctxt": 0
},
"value": "decreaseIndent",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ReturnStatement",
"span": {
"start": 1858,
"end": 1869,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 1865,
"end": 1868,
"ctxt": 0
},
"value": "ast",
"optional": false
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
}
]
}
}
],
"interpreter": null
}