{ "objects": { "SourceLocation": { "fields": { "source": { "type": "Option" }, "start": { "type": "Position" }, "end": { "type": "Position" } } }, "Position": { "fields": { "line": { "type": "NonZeroU32" }, "column": { "type": "u32" } } }, "Class": { "visitor": true, "fields": { "id": { "type": "Option" }, "super_class": { "type": "Option", "rename": "superClass" }, "body": { "type": "ClassBody" } } }, "Function": { "visitor": true, "fields": { "id": { "type": "Option" }, "params": { "type": "Vec" }, "body": { "type": "Option" }, "is_generator": { "type": "bool", "optional": true, "rename": "generator" }, "is_async": { "type": "bool", "optional": true, "rename": "async" }, "loc": { "type": "Option", "optional": true }, "range": { "type": "Option", "optional": true } } }, "RegExpValue": { "fields": { "pattern": { "type": "String" }, "flags": { "type": "String" } } }, "TemplateElementValue": { "fields": { "cooked": { "type": "Option" }, "raw": { "type": "String" } } } }, "nodes": { "Identifier": { "fields": { "name": { "type": "String" }, "binding": { "type": "Option", "optional": true, "skip": true }, "type_annotation": { "type": "Option", "optional": true, "rename": "typeAnnotation", "hermes_default": true, "TODO": "support HermesParser" } } }, "Literal": { "skip_hermes_codegen": true, "skip_hermes_enum_variant": true, "fields": { "value": { "type": "JsValue" }, "raw": { "type": "Option", "optional": true }, "regex": { "type": "Option", "optional": true }, "bigint": { "type": "Option", "optional": true } } }, "NumericLiteral": { "fields": { "value": { "type": "Number" } } }, "BooleanLiteral": { "fields": { "value": { "type": "bool" } } }, "NullLiteral": {}, "StringLiteral": { "fields": { "value": { "type": "String", "hermes_convert_with": "convert_string_value" } } }, "RegExpLiteral": { "fields": { "pattern": { "type": "String" }, "flags": { "type": "String" } } }, "Program": { "fields": { "body": { "type": "Vec" }, "source_type": { "type": "SourceType", "optional": true, "rename": "sourceType", "hermes_default": true } } }, "ExpressionStatement": { "fields": { "expression": { "type": "Expression" }, "directive": { "type": "Option", "optional": true, "hermes_default": true } } }, "BlockStatement": { "fields": { "body": { "type": "Vec" } } }, "EmptyStatement": {}, "DebuggerStatement": {}, "WithStatement": { "fields": { "object": { "type": "Expression" }, "body": { "type": "Statement" } } }, "ReturnStatement": { "fields": { "argument": { "type": "Option" } } }, "LabeledStatement": { "fields": { "label": { "type": "Identifier" }, "body": { "type": "Statement" } } }, "BreakStatement": { "fields": { "label": { "type": "Option" } } }, "ContinueStatement": { "fields": { "label": { "type": "Option" } } }, "IfStatement": { "fields": { "test": { "type": "Expression" }, "consequent": { "type": "Statement" }, "alternate": { "type": "Option" } } }, "SwitchStatement": { "fields": { "discriminant": { "type": "Expression" }, "cases": { "type": "Vec" } } }, "SwitchCase": { "fields": { "test": { "type": "Option" }, "consequent": { "type": "Vec" } } }, "ThrowStatement": { "fields": { "argument": { "type": "Expression" } } }, "TryStatement": { "fields": { "block": { "type": "BlockStatement" }, "handler": { "type": "Option" }, "finalizer": { "type": "Option" } } }, "CatchClause": { "fields": { "param": { "type": "Option" }, "body": { "type": "BlockStatement" } } }, "WhileStatement": { "fields": { "test": { "type": "Expression" }, "body": { "type": "Statement" } } }, "DoWhileStatement": { "fields": { "body": { "type": "Statement" }, "test": { "type": "Expression" } } }, "ForStatement": { "fields": { "init": { "type": "Option" }, "test": { "type": "Option" }, "update": { "type": "Option" }, "body": { "type": "Statement" } } }, "ForInStatement": { "fields": { "left": { "type": "ForInInit" }, "right": { "type": "Expression" }, "body": { "type": "Statement" } } }, "ForOfStatement": { "fields": { "is_await": { "type": "bool", "optional": true, "rename": "await" }, "left": { "type": "ForInInit" }, "right": { "type": "Expression" }, "body": { "type": "Statement" } } }, "FunctionDeclaration": { "skip_hermes_codegen": true, "fields": { "function": { "type": "Function", "flatten": true } } }, "ClassDeclaration": { "skip_hermes_codegen": true, "fields": { "class": { "type": "Class", "flatten": true } } }, "ClassExpression": { "skip_hermes_codegen": true, "fields": { "class": { "type": "Class", "flatten": true } } }, "ClassBody": { "fields": { "body": { "type": "Vec" } } }, "MethodDefinition": { "fields": { "key": { "type": "Expression" }, "value": { "type": "FunctionExpression" }, "kind": { "type": "MethodKind" }, "is_computed": { "type": "bool", "rename": "computed" }, "is_static": { "type": "bool", "rename": "static" } } }, "VariableDeclaration": { "fields": { "kind": { "type": "VariableDeclarationKind" }, "declarations": { "type": "Vec" } } }, "VariableDeclarator": { "fields": { "id": { "type": "Pattern" }, "init": { "type": "Option" } } }, "ThisExpression": {}, "ArrayExpression": { "fields": { "elements": { "type": "Vec>", "hermes_convert_with": "convert_array_expression_elements" } } }, "ObjectExpression": { "fields": { "properties": { "type": "Vec" } } }, "Property": { "fields": { "key": { "type": "Expression" }, "value": { "type": "Expression" }, "kind": { "type": "PropertyKind" }, "is_method": { "type": "bool", "rename": "method" }, "is_shorthand": { "type": "bool", "rename": "shorthand" }, "is_computed": { "type": "bool", "rename": "computed" } } }, "FunctionExpression": { "skip_hermes_codegen": true, "fields": { "function": { "type": "Function", "flatten": true } } }, "ArrowFunctionExpression": { "skip_hermes_codegen": true, "fields": { "function": { "type": "Function", "flatten": true }, "is_expression": { "type": "bool", "rename": "expression" } } }, "UnaryExpression": { "fields": { "operator": { "type": "UnaryOperator" }, "prefix": { "type": "bool" }, "argument": { "type": "Expression" } } }, "UpdateExpression": { "fields": { "operator": { "type": "UpdateOperator" }, "argument": { "type": "Expression" }, "prefix": { "type": "bool" } } }, "BinaryExpression": { "fields": { "left": { "type": "Expression" }, "operator": { "type": "BinaryOperator" }, "right": { "type": "Expression" } } }, "AssignmentExpression": { "fields": { "operator": { "type": "AssignmentOperator" }, "left": { "type": "AssignmentTarget" }, "right": { "type": "Expression" } } }, "LogicalExpression": { "fields": { "operator": { "type": "LogicalOperator" }, "left": { "type": "Expression" }, "right": { "type": "Expression" } } }, "MemberExpression": { "fields": { "object": { "type": "ExpressionOrSuper" }, "property": { "type": "ExpressionOrPrivateIdentifier" }, "is_computed": { "type": "bool", "rename": "computed" } } }, "ConditionalExpression": { "fields": { "test": { "type": "Expression" }, "alternate": { "type": "Expression" }, "consequent": { "type": "Expression" } } }, "CallExpression": { "fields": { "callee": { "type": "ExpressionOrSuper" }, "arguments": { "type": "Vec" } } }, "NewExpression": { "fields": { "callee": { "type": "Expression" }, "arguments": { "type": "Vec" } } }, "SequenceExpression": { "fields": { "expressions": { "type": "Vec" } } }, "Super": {}, "SpreadElement": { "fields": { "argument": { "type": "Expression" } } }, "YieldExpression": { "fields": { "argument": { "type": "Option", "optional": true }, "is_delegate": { "type": "bool", "rename": "delegate" } } }, "ImportDeclaration": { "fields": { "specifiers": { "type": "Vec" }, "source": { "type": "_Literal" } } }, "ImportSpecifier": { "fields": { "imported": { "type": "Identifier" }, "local": { "type": "Identifier" } } }, "ImportDefaultSpecifier": { "fields": { "local": { "type": "Identifier" } } }, "ImportNamespaceSpecifier": { "fields": { "local": { "type": "Identifier" } } }, "ExportNamedDeclaration": { "fields": { "declaration": { "type": "Option" }, "specifiers": { "type": "Vec" }, "source": { "type": "Option<_Literal>" } } }, "ExportSpecifier": { "fields": { "exported": { "type": "Identifier" } } }, "ExportDefaultDeclaration": { "fields": { "declaration": { "type": "DeclarationOrExpression" } } }, "ExportAllDeclaration": { "fields": { "source": { "type": "_Literal" }, "exported": { "type": "Option", "optional": true, "hermes_default": true } } }, "JSXIdentifier": { "fields": { "name": { "type": "String" }, "binding": { "type": "Option", "optional": true, "skip": true } } }, "JSXNamespacedName": { "fields": { "namespace": { "type": "JSXIdentifier" }, "name": { "type": "JSXIdentifier" } } }, "JSXMemberExpression": { "fields": { "object": { "type": "JSXMemberExpressionOrIdentifier" }, "property": { "type": "JSXIdentifier" } } }, "JSXEmptyExpression": {}, "JSXExpressionContainer": { "fields": { "expression": { "type": "JSXExpressionOrEmpty" } } }, "JSXSpreadChild": { "fields": { "expression": { "type": "Expression" } } }, "JSXOpeningElement": { "fields": { "name": { "type": "JSXElementName" }, "attributes": { "type": "Vec" }, "self_closing": { "type": "bool", "rename": "selfClosing" } } }, "JSXClosingElement": { "fields": { "name": { "type": "JSXElementName" } } }, "JSXAttribute": { "fields": { "name": { "type": "JSXIdentifierOrNamespacedName" }, "value": { "type": "Option" } } }, "JSXSpreadAttribute": { "fields": { "argument": { "type": "Expression" } } }, "JSXText": { "fields": { "value": { "type": "String", "hermes_convert_with": "convert_string_value" }, "raw": { "type": "String" } } }, "JSXStringLiteral": { "fields": { "value": { "type": "String", "hermes_convert_with": "convert_string_value" }, "raw": { "type": "String" } }, "TODO": "Non-standard HermesParser node" }, "JSXElement": { "fields": { "opening_element": { "type": "JSXOpeningElement", "rename": "openingElement" }, "children": { "type": "Vec" }, "closing_element": { "type": "Option", "rename": "closingElement" } } }, "JSXFragment": { "fields": { "opening_fragment": { "type": "JSXOpeningFragment", "rename": "openingFragment" }, "children": { "type": "Vec" }, "closing_fragment": { "type": "JSXClosingFragment", "rename": "closingFragment" } } }, "JSXOpeningFragment": {}, "JSXClosingFragment": {}, "ArrayPattern": { "fields": { "elements": { "type": "Vec>" } } }, "ObjectPattern": { "fields": { "properties": { "type": "Vec" } } }, "AssignmentProperty": { "skip_hermes_codegen": true, "type": "Property", "fields": { "key": { "type": "Expression" }, "value": { "type": "Pattern" }, "kind": { "type": "PropertyKind", "TODO": "fixed value `init`" }, "is_computed": { "type": "bool", "rename": "computed" }, "is_shorthand": { "type": "bool", "rename": "shorthand" }, "is_method": { "type": "bool", "rename": "method", "TODO": "fixed value `false`" } } }, "RestElement": { "fields": { "argument": { "type": "Pattern" } } }, "AssignmentPattern": { "fields": { "left": { "type": "Pattern" }, "right": { "type": "Expression" } } }, "TemplateLiteral": { "fields": { "quasis": { "type": "Vec" }, "expressions": { "type": "Vec" } } }, "TemplateElement": { "skip_hermes_codegen": true, "fields": { "tail": { "type": "bool" }, "value": { "type": "TemplateElementValue" } } }, "TaggedTemplateExpression": { "fields": { "tag": { "type": "Expression" }, "quasi": { "type": "TemplateLiteral" } } }, "MetaProperty": { "fields": { "meta": { "type": "Identifier" }, "property": { "type": "Identifier" } } }, "AwaitExpression": { "fields": { "argument": { "type": "Expression" } } }, "ChainExpression": { "skip_hermes_codegen": true, "skip_hermes_enum_variant": true, "fields": { "expression": { "type": "ChainElement" } } }, "OptionalMemberExpression": { "fields": { "object": { "type": "Expression" }, "property": { "type": "Expression" }, "is_computed": { "type": "bool", "rename": "computed" }, "is_optional": { "type": "bool", "optional": true, "rename": "optional" } } }, "OptionalCallExpression": { "fields": { "callee": { "type": "ExpressionOrSuper" }, "arguments": { "type": "Vec" }, "is_optional": { "type": "bool", "optional": true, "rename": "optional" } } }, "ImportExpression": { "fields": { "source": { "type": "Expression" } } }, "ClassProperty": { "fields": { "key": { "type": "Expression" }, "value": { "type": "Option", "optional": true }, "is_computed": { "type": "bool", "rename": "computed" }, "is_static": { "type": "bool", "rename": "static" } } }, "ClassPrivateProperty": { "fields": { "key": { "type": "ExpressionOrPrivateIdentifier" }, "value": { "type": "Option", "optional": true }, "is_static": { "type": "bool", "rename": "static" } }, "TODO": "Non-standard HermesParser node" }, "PrivateName": { "fields": { "id": { "type": "Identifier" } }, "TODO": "Non-standard HermesParser node" }, "PrivateIdentifier": { "skip_hermes_codegen": true, "skip_hermes_enum_variant": true, "fields": { "name": { "type": "String" } } }, "StaticBlock": { "skip_hermes_codegen": true, "skip_hermes_enum_variant": true, "fields": { "body": { "type": "Vec" } }, "TODO": "not yet supported in HermesParser" }, "CoverTypedIdentifier": { "fields": { "left": { "type": "Identifier" }, "right": { "type": "Option" } }, "TODO": "Non-standard HermesParser node" }, "TSTypeAnnotation": {}, "TSTypeAliasDeclaration": {} }, "enums": { "Statement": [ "BlockStatement", "BreakStatement", "ClassDeclaration", "ContinueStatement", "DebuggerStatement", "DoWhileStatement", "EmptyStatement", "ExpressionStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FunctionDeclaration", "IfStatement", "LabeledStatement", "ReturnStatement", "SwitchStatement", "ThrowStatement", "TryStatement", "TSTypeAliasDeclaration", "VariableDeclaration", "WhileStatement", "WithStatement" ], "Expression": [ "ArrayExpression", "ArrowFunctionExpression", "AssignmentExpression", "AwaitExpression", "BinaryExpression", "BooleanLiteral", "CallExpression", "ChainExpression", "ClassExpression", "ConditionalExpression", "CoverTypedIdentifier", "FunctionExpression", "Identifier", "ImportExpression", "JSXElement", "JSXFragment", "Literal", "LogicalExpression", "MemberExpression", "MetaProperty", "NewExpression", "NullLiteral", "NumericLiteral", "ObjectExpression", "OptionalCallExpression", "OptionalMemberExpression", "RegExpLiteral", "SequenceExpression", "StringLiteral", "TaggedTemplateExpression", "TemplateLiteral", "ThisExpression", "UnaryExpression", "UpdateExpression", "YieldExpression" ], "_Literal": [ "Literal", "BooleanLiteral", "NullLiteral", "StringLiteral", "NumericLiteral" ], "Declaration": [ "ClassDeclaration", "FunctionDeclaration", "VariableDeclaration", "TSTypeAliasDeclaration" ], "ImportDeclarationSpecifier": [ "ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier" ], "ModuleItem": [ "ImportOrExportDeclaration", "Statement" ], "ImportOrExportDeclaration": [ "ImportDeclaration", "ExportNamedDeclaration", "ExportDefaultDeclaration", "ExportAllDeclaration" ], "ExpressionOrSuper": [ "Expression", "Super" ], "ExpressionOrSpread": [ "Expression", "SpreadElement" ], "FunctionBody": [ "BlockStatement", "Expression" ], "Pattern": [ "Identifier", "ArrayPattern", "ObjectPattern", "RestElement", "AssignmentPattern" ], "ForInit": [ "Expression", "VariableDeclaration" ], "ForInInit": [ "Pattern", "VariableDeclaration" ], "PropertyOrSpreadElement": [ "Property", "SpreadElement" ], "AssignmentPropertyOrRestElement": [ "AssignmentProperty", "RestElement" ], "AssignmentTarget": [ "Pattern", "Expression" ], "ChainElement": [ "CallExpression", "MemberExpression" ], "JSXMemberExpressionOrIdentifier": [ "JSXMemberExpression", "JSXIdentifier" ], "JSXExpressionOrEmpty": [ "Expression", "JSXEmptyExpression" ], "JSXAttributeOrSpread": [ "JSXAttribute", "JSXSpreadAttribute" ], "JSXAttributeValue": [ "Literal", "JSXExpressionContainer", "JSXElement", "JSXFragment", "JSXStringLiteral" ], "JSXElementName": [ "JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName" ], "JSXIdentifierOrNamespacedName": [ "JSXIdentifier", "JSXNamespacedName" ], "JSXChildItem": [ "JSXText", "JSXStringLiteral", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment" ], "DeclarationOrExpression": [ "Declaration", "Expression" ], "ClassItem": [ "MethodDefinition", "ClassProperty", "ClassPrivateProperty", "StaticBlock" ], "ExpressionOrPrivateIdentifier": [ "Expression", "PrivateIdentifier", "PrivateName" ], "TypeAnnotation": [ "TSTypeAnnotation" ] }, "operators": { "VariableDeclarationKind": { "Const": "const", "Let": "let", "Var": "var" }, "PropertyKind": { "Get": "get", "Init": "init", "Set": "set" }, "UnaryOperator": { "Delete": "delete", "Minus": "-", "Negation": "!", "Plus": "+", "Tilde": "~", "Typeof": "typeof", "Void": "void" }, "UpdateOperator": { "Decrement": "--", "Increment": "++" }, "BinaryOperator": { "Add": "+", "BinaryAnd": "&", "BinaryOr": "|", "BinaryXor": "^", "Divide": "/", "Equals": "==", "Exponent": "**", "GreaterThan": ">", "GreaterThanOrEqual": ">=", "In": "in", "Instanceof": "instanceof", "LessThan": "<", "LessThanOrEqual": "<=", "Modulo": "%", "Multiply": "*", "NotEquals": "!=", "NotStrictEquals": "!==", "ShiftLeft": "<<", "ShiftRight": ">>", "StrictEquals": "===", "Subtract": "-", "UnsignedShiftRight": ">>>" }, "AssignmentOperator": { "BinaryAndEquals": "&=", "BinaryOrEquals": "|=", "BinaryXorEquals": "^=", "DivideEquals": "/=", "Equals": "=", "Exponent": "**=", "MinusEquals": "-=", "ModuloEquals": "%=", "MultiplyEquals": "*=", "PlusEquals": "+=", "ShiftLeftEquals": "<<=", "ShiftRightEquals": ">>=", "UnsignedShiftRightEquals": ">>>=", "AndEquals": "&&=", "OrEquals": "||=", "NullCoalescingEquals": "??=" }, "LogicalOperator": { "And": "&&", "NullCoalescing": "??", "Or": "||" }, "SourceType": { "Script": "script", "Module": "module" }, "MethodKind": { "Constructor": "constructor", "Method": "method", "Get": "get", "Set": "set" } } }