diff --git a/src/ast-spec.txt b/src/ast-spec.txt index 100854b2b..b0b4b2649 100644 --- a/src/ast-spec.txt +++ b/src/ast-spec.txt @@ -84,7 +84,7 @@ node BoltBracketed > BoltPunctuated; node BoltSourceFile > BoltSyntax, SourceFile { elements: Vec, - package: Package, + pkg: Package, } node BoltQualName > BoltSyntax { @@ -101,7 +101,7 @@ node BoltTypeOfExpression > BoltTypeExpression { node BoltReferenceTypeExpression > BoltTypeExpression { name: BoltQualName, - arguments: Option>, + typeArgs: Option>, } node BoltFunctionTypeExpression > BoltTypeExpression { @@ -265,7 +265,7 @@ node BoltDeclarationLike; node BoltFunctionBodyElement > FunctionBodyElement; -node BoltFunctionDeclaration > BoltFunctionBodyElement, BoltDeclaration, BoltDeclarationLike { +node BoltFunctionDeclaration > BoltFunctionBodyElement, BoltDeclaration, BoltDeclarationLike, BoltTraitOrImplElement { modifiers: BoltModifiers, target: String, name: BoltSymbol, @@ -307,22 +307,25 @@ node BoltExportDirective > BoltSourceElement { symbols: Option>, } +node BoltTraitOrImplElement; + node BoltTraitDeclaration > BoltDeclarationLike, BoltTypeDeclaration { modifiers: BoltModifiers, - name: BoltIdentifier, typeParams: Option>, - elements: Vec, + name: BoltIdentifier, + typeBoundExpr: Option, + elements: Option>, } node BoltImplDeclaration > BoltTypeDeclaration, BoltDeclarationLike { modifiers: BoltModifiers, - name: BoltIdentifier, - trait: BoltTypeExpression, typeParams: Option>, + name: BoltIdentifier, + traitTypeExpr: Option, elements: Vec, } -node BoltTypeAliasDeclaration > BoltDeclarationLike, BoltTypeDeclaration { +node BoltTypeAliasDeclaration > BoltDeclarationLike, BoltTypeDeclaration, BoltTraitOrImplElement { modifiers: BoltModifiers, name: BoltIdentifier, typeParams: Option>, @@ -345,7 +348,7 @@ node BoltRecordDeclaration > BoltDeclaration, BoltTypeDeclaration, BoltDeclarati node BoltSourceElement; -node BoltMacroCall > BoltRecordMember, BoltStatement, BoltDeclaration, BoltExpression { +node BoltMacroCall > BoltRecordMember, BoltSourceElement, BoltTraitOrImplElement, BoltFunctionBodyElement { name: BoltIdentifier, text: String, } @@ -356,10 +359,6 @@ node JSSyntax; node JSToken > JSSyntax, Token; -node JSOperator > JSToken { - text: String, -} - node JSIdentifier > JSToken { text: String, } @@ -386,7 +385,11 @@ node JSFunctionKeyword > JSToken; node JSWhileKeyword > JSToken; node JSForKeyword > JSToken; -node JSOperator; +node JSOperatorLike; + +node JSOperator > JSToken { + text: String, +} node JSCloseBrace > JSToken; node JSCloseBracket > JSToken; @@ -398,17 +401,17 @@ node JSSemi > JSToken; node JSComma > JSToken; node JSDot > JSToken; node JSDotDotDot > JSToken; -node JSMulOp > JSToken, JSOperator; -node JSAddOp > JSToken, JSOperator; -node JSDivOp > JSToken, JSOperator; -node JSSubOp > JSToken, JSOperator; -node JSLtOp > JSToken, JSOperator; -node JSGtOp > JSToken, JSOperator; -node JSBOrOp > JSToken, JSOperator; -node JSBXorOp > JSToken, JSOperator; -node JSBAndOp > JSToken, JSOperator; -node JSBNotOp > JSToken, JSOperator; -node JSNotOp > JSToken, JSOperator; +node JSMulOp > JSToken, JSOperatorLike; +node JSAddOp > JSToken, JSOperatorLike; +node JSDivOp > JSToken, JSOperatorLike; +node JSSubOp > JSToken, JSOperatorLike; +node JSLtOp > JSToken, JSOperatorLike; +node JSGtOp > JSToken, JSOperatorLike; +node JSBOrOp > JSToken, JSOperatorLike; +node JSBXorOp > JSToken, JSOperatorLike; +node JSBAndOp > JSToken, JSOperatorLike; +node JSBNotOp > JSToken, JSOperatorLike; +node JSNotOp > JSToken, JSOperatorLike; node JSPattern > JSSyntax; @@ -445,7 +448,7 @@ node JSUnaryExpression > JSExpression { node JSNewExpression > JSExpression { target: JSExpression, - arguments: Vec, + args: Vec, } node JSSequenceExpression > JSExpression { @@ -548,4 +551,4 @@ node JSLetDeclaration > JSDeclaration, JSFunctionBodyElement { node JSSourceFile > JSSyntax, SourceFile { elements: Vec, -} \ No newline at end of file +} diff --git a/src/ast.d.ts b/src/ast.d.ts index 8bf38d30a..8dc0d4144 100644 --- a/src/ast.d.ts +++ b/src/ast.d.ts @@ -135,6 +135,7 @@ export class NodeVisitor { protected visitJSFunctionKeyword?(node: JSFunctionKeyword): void; protected visitJSWhileKeyword?(node: JSWhileKeyword): void; protected visitJSForKeyword?(node: JSForKeyword): void; + protected visitJSOperator?(node: JSOperator): void; protected visitJSCloseBrace?(node: JSCloseBrace): void; protected visitJSCloseBracket?(node: JSCloseBracket): void; protected visitJSCloseParen?(node: JSCloseParen): void; @@ -269,12 +270,12 @@ export const enum SyntaxKind { BoltExportSymbol = 101, BoltPlainExportSymbol = 102, BoltExportDirective = 103, - BoltTraitDeclaration = 104, - BoltImplDeclaration = 105, - BoltTypeAliasDeclaration = 106, - BoltRecordField = 108, - BoltRecordDeclaration = 109, - BoltMacroCall = 111, + BoltTraitDeclaration = 105, + BoltImplDeclaration = 106, + BoltTypeAliasDeclaration = 107, + BoltRecordField = 109, + BoltRecordDeclaration = 110, + BoltMacroCall = 112, JSIdentifier = 115, JSString = 116, JSInteger = 117, @@ -291,52 +292,53 @@ export const enum SyntaxKind { JSFunctionKeyword = 128, JSWhileKeyword = 129, JSForKeyword = 130, - JSCloseBrace = 132, - JSCloseBracket = 133, - JSCloseParen = 134, - JSOpenBrace = 135, - JSOpenBracket = 136, - JSOpenParen = 137, - JSSemi = 138, - JSComma = 139, - JSDot = 140, - JSDotDotDot = 141, - JSMulOp = 142, - JSAddOp = 143, - JSDivOp = 144, - JSSubOp = 145, - JSLtOp = 146, - JSGtOp = 147, - JSBOrOp = 148, - JSBXorOp = 149, - JSBAndOp = 150, - JSBNotOp = 151, - JSNotOp = 152, - JSBindPattern = 154, - JSConstantExpression = 156, - JSMemberExpression = 157, - JSCallExpression = 158, - JSBinaryExpression = 159, - JSUnaryExpression = 160, - JSNewExpression = 161, - JSSequenceExpression = 162, - JSConditionalExpression = 163, - JSLiteralExpression = 164, - JSReferenceExpression = 165, - JSCatchBlock = 169, - JSTryCatchStatement = 170, - JSExpressionStatement = 171, - JSConditionalCase = 172, - JSConditionalStatement = 173, - JSReturnStatement = 174, - JSParameter = 175, - JSImportStarBinding = 179, - JSImportAsBinding = 180, - JSImportDeclaration = 181, - JSFunctionDeclaration = 182, - JSArrowFunctionDeclaration = 183, - JSLetDeclaration = 184, - JSSourceFile = 185, + JSOperator = 132, + JSCloseBrace = 133, + JSCloseBracket = 134, + JSCloseParen = 135, + JSOpenBrace = 136, + JSOpenBracket = 137, + JSOpenParen = 138, + JSSemi = 139, + JSComma = 140, + JSDot = 141, + JSDotDotDot = 142, + JSMulOp = 143, + JSAddOp = 144, + JSDivOp = 145, + JSSubOp = 146, + JSLtOp = 147, + JSGtOp = 148, + JSBOrOp = 149, + JSBXorOp = 150, + JSBAndOp = 151, + JSBNotOp = 152, + JSNotOp = 153, + JSBindPattern = 155, + JSConstantExpression = 157, + JSMemberExpression = 158, + JSCallExpression = 159, + JSBinaryExpression = 160, + JSUnaryExpression = 161, + JSNewExpression = 162, + JSSequenceExpression = 163, + JSConditionalExpression = 164, + JSLiteralExpression = 165, + JSReferenceExpression = 166, + JSCatchBlock = 170, + JSTryCatchStatement = 171, + JSExpressionStatement = 172, + JSConditionalCase = 173, + JSConditionalStatement = 174, + JSReturnStatement = 175, + JSParameter = 176, + JSImportStarBinding = 180, + JSImportAsBinding = 181, + JSImportDeclaration = 182, + JSFunctionDeclaration = 183, + JSArrowFunctionDeclaration = 184, + JSLetDeclaration = 185, + JSSourceFile = 186, } export interface EndOfFile extends SyntaxBase { @@ -407,6 +409,7 @@ export type Token | JSFunctionKeyword | JSWhileKeyword | JSForKeyword + | JSOperator | JSCloseBrace | JSCloseBracket | JSCloseParen @@ -486,11 +489,11 @@ export type FunctionBodyElement | JSReturnStatement | BoltFunctionDeclaration | BoltVariableDeclaration + | BoltMacroCall | BoltReturnStatement | BoltConditionalStatement | BoltResumeStatement | BoltExpressionStatement - | BoltMacroCall export type ReturnStatement @@ -2838,7 +2841,7 @@ export type BoltBracketedChild export interface BoltSourceFile extends SyntaxBase { kind: SyntaxKind.BoltSourceFile; elements: BoltSourceElement[]; - package: Package; + pkg: Package; parentNode: BoltSourceFileParent; getChildNodes(): IterableIterator } @@ -2894,6 +2897,7 @@ export type BoltTypeOfExpressionParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField @@ -2909,13 +2913,13 @@ export type BoltTypeOfExpressionAnyParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField | BoltRecordDeclaration | BoltSourceFile | BoltModule -| BoltTraitDeclaration | BoltBlockExpression | BoltConditionalCase | BoltLiftedTypeExpression @@ -2940,7 +2944,7 @@ export type BoltTypeOfExpressionChild export interface BoltReferenceTypeExpression extends SyntaxBase { kind: SyntaxKind.BoltReferenceTypeExpression; name: BoltQualName; - arguments: BoltTypeExpression[] | null; + typeArgs: BoltTypeExpression[] | null; parentNode: BoltReferenceTypeExpressionParent; getChildNodes(): IterableIterator } @@ -2955,6 +2959,7 @@ export type BoltReferenceTypeExpressionParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField @@ -2969,13 +2974,13 @@ export type BoltReferenceTypeExpressionAnyParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField | BoltRecordDeclaration | BoltSourceFile | BoltModule -| BoltTraitDeclaration | BoltBlockExpression | BoltConditionalCase | BoltTypeOfExpression @@ -3016,6 +3021,7 @@ export type BoltFunctionTypeExpressionParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField @@ -3030,13 +3036,13 @@ export type BoltFunctionTypeExpressionAnyParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField | BoltRecordDeclaration | BoltSourceFile | BoltModule -| BoltTraitDeclaration | BoltBlockExpression | BoltConditionalCase | BoltTypeOfExpression @@ -3076,6 +3082,7 @@ export type BoltLiftedTypeExpressionParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField @@ -3091,13 +3098,13 @@ export type BoltLiftedTypeExpressionAnyParent | BoltParameter | BoltFunctionDeclaration | BoltVariableDeclaration +| BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordField | BoltRecordDeclaration | BoltSourceFile | BoltModule -| BoltTraitDeclaration | BoltBlockExpression | BoltConditionalCase | BoltTypeOfExpression @@ -3467,7 +3474,6 @@ export type BoltExpression | BoltCaseExpression | BoltBlockExpression | BoltConstantExpression - | BoltMacroCall export interface BoltQuoteExpression extends SyntaxBase { @@ -4222,7 +4228,6 @@ export type BoltStatement | BoltConditionalStatement | BoltResumeStatement | BoltExpressionStatement - | BoltMacroCall export interface BoltReturnStatement extends SyntaxBase { @@ -4482,7 +4487,6 @@ export type BoltDeclaration = BoltFunctionDeclaration | BoltVariableDeclaration | BoltRecordDeclaration - | BoltMacroCall export type BoltTypeDeclaration @@ -4528,11 +4532,11 @@ export type BoltDeclarationLike export type BoltFunctionBodyElement = BoltFunctionDeclaration | BoltVariableDeclaration + | BoltMacroCall | BoltReturnStatement | BoltConditionalStatement | BoltResumeStatement | BoltExpressionStatement - | BoltMacroCall export interface BoltFunctionDeclaration extends SyntaxBase { @@ -4756,12 +4760,19 @@ export type BoltExportDirectiveAnyParent export type BoltExportDirectiveChild = never +export type BoltTraitOrImplElement + = BoltFunctionDeclaration + | BoltTypeAliasDeclaration + | BoltMacroCall + + export interface BoltTraitDeclaration extends SyntaxBase { kind: SyntaxKind.BoltTraitDeclaration; modifiers: BoltModifiers; - name: BoltIdentifier; typeParams: BoltTypeParameter[] | null; - elements: BoltDeclaration[]; + name: BoltIdentifier; + typeBoundExpr: BoltTypeExpression | null; + elements: BoltDeclaration[] | null; parentNode: BoltTraitDeclarationParent; getChildNodes(): IterableIterator } @@ -4782,9 +4793,9 @@ export type BoltTraitDeclarationChild export interface BoltImplDeclaration extends SyntaxBase { kind: SyntaxKind.BoltImplDeclaration; modifiers: BoltModifiers; - name: BoltIdentifier; - trait: BoltTypeExpression; typeParams: BoltTypeParameter[] | null; + name: BoltIdentifier; + traitTypeExpr: BoltTypeExpression | null; elements: BoltDeclaration[]; parentNode: BoltImplDeclarationParent; getChildNodes(): IterableIterator @@ -4885,13 +4896,13 @@ export type BoltSourceElement = BoltModule | BoltImportDirective | BoltExportDirective + | BoltMacroCall | BoltTraitDeclaration | BoltImplDeclaration | BoltTypeAliasDeclaration | BoltRecordDeclaration | BoltFunctionDeclaration | BoltVariableDeclaration - | BoltMacroCall | BoltReturnStatement | BoltConditionalStatement | BoltResumeStatement @@ -4908,56 +4919,39 @@ export interface BoltMacroCall extends SyntaxBase { export type BoltMacroCallParent = BoltSourceFile -| BoltTypeOfExpression -| BoltLiftedTypeExpression -| BoltExpressionPattern -| BoltTupleExpression -| BoltMemberExpression | BoltFunctionExpression -| BoltCallExpression -| BoltYieldExpression -| BoltMatchArm -| BoltMatchExpression -| BoltCase | BoltBlockExpression -| BoltReturnStatement | BoltConditionalCase -| BoltResumeStatement -| BoltExpressionStatement -| BoltParameter | BoltModule | BoltFunctionDeclaration -| BoltVariableDeclaration -| BoltTraitDeclaration -| BoltImplDeclaration | BoltRecordDeclaration | never export type BoltMacroCallAnyParent = BoltSourceFile +| BoltFunctionExpression +| BoltBlockExpression +| BoltConditionalCase +| BoltModule +| BoltFunctionDeclaration +| BoltRecordDeclaration +| BoltTraitDeclaration +| BoltImplDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern | BoltTupleExpression | BoltMemberExpression -| BoltFunctionExpression | BoltCallExpression | BoltYieldExpression | BoltMatchArm | BoltMatchExpression | BoltCase -| BoltBlockExpression | BoltReturnStatement -| BoltConditionalCase | BoltResumeStatement | BoltExpressionStatement | BoltParameter -| BoltModule -| BoltFunctionDeclaration | BoltVariableDeclaration -| BoltTraitDeclaration -| BoltImplDeclaration -| BoltRecordDeclaration | BoltTypePattern | BoltTuplePatternElement | BoltRecordFieldPattern @@ -5015,6 +5009,7 @@ export type JSSyntax | JSFunctionKeyword | JSWhileKeyword | JSForKeyword + | JSOperator | JSCloseBrace | JSCloseBracket | JSCloseParen @@ -5056,6 +5051,7 @@ export type JSToken | JSFunctionKeyword | JSWhileKeyword | JSForKeyword + | JSOperator | JSCloseBrace | JSCloseBracket | JSCloseParen @@ -5079,20 +5075,6 @@ export type JSToken | JSNotOp -export type JSOperator - = JSMulOp - | JSAddOp - | JSDivOp - | JSSubOp - | JSLtOp - | JSGtOp - | JSBOrOp - | JSBXorOp - | JSBAndOp - | JSBNotOp - | JSNotOp - - export interface JSIdentifier extends SyntaxBase { kind: SyntaxKind.JSIdentifier; text: string; @@ -5896,7 +5878,7 @@ export type JSForKeywordAnyParent export type JSForKeywordChild = never -export type JSOperator +export type JSOperatorLike = JSMulOp | JSAddOp | JSDivOp @@ -5910,6 +5892,57 @@ export type JSOperator | JSNotOp +export interface JSOperator extends SyntaxBase { + kind: SyntaxKind.JSOperator; + text: string; + parentNode: JSOperatorParent; + getChildNodes(): IterableIterator +} + +export type JSOperatorParent += BoltQuoteExpression +| never + +export type JSOperatorAnyParent += BoltQuoteExpression +| BoltTypeOfExpression +| BoltLiftedTypeExpression +| BoltExpressionPattern +| BoltTupleExpression +| BoltMemberExpression +| BoltCallExpression +| BoltYieldExpression +| BoltMatchArm +| BoltMatchExpression +| BoltCase +| BoltReturnStatement +| BoltConditionalCase +| BoltResumeStatement +| BoltExpressionStatement +| BoltParameter +| BoltVariableDeclaration +| BoltSourceFile +| BoltFunctionExpression +| BoltBlockExpression +| BoltModule +| BoltFunctionDeclaration +| BoltTraitDeclaration +| BoltImplDeclaration +| BoltTypePattern +| BoltTuplePatternElement +| BoltRecordFieldPattern +| BoltReferenceTypeExpression +| BoltFunctionTypeExpression +| BoltTypeParameter +| BoltRecordPattern +| BoltTypeAliasDeclaration +| BoltRecordField +| BoltRecordDeclaration +| never + +export type JSOperatorChild += never + export interface JSCloseBrace extends SyntaxBase { kind: SyntaxKind.JSCloseBrace; parentNode: JSCloseBraceParent; @@ -6418,29 +6451,10 @@ export interface JSMulOp extends SyntaxBase { export type JSMulOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSMulOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6487,29 +6501,10 @@ export interface JSAddOp extends SyntaxBase { export type JSAddOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSAddOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6556,29 +6551,10 @@ export interface JSDivOp extends SyntaxBase { export type JSDivOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSDivOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6625,29 +6601,10 @@ export interface JSSubOp extends SyntaxBase { export type JSSubOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSSubOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6694,29 +6651,10 @@ export interface JSLtOp extends SyntaxBase { export type JSLtOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSLtOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6763,29 +6701,10 @@ export interface JSGtOp extends SyntaxBase { export type JSGtOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSGtOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6832,29 +6751,10 @@ export interface JSBOrOp extends SyntaxBase { export type JSBOrOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSBOrOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6901,29 +6801,10 @@ export interface JSBXorOp extends SyntaxBase { export type JSBXorOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSBXorOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -6970,29 +6851,10 @@ export interface JSBAndOp extends SyntaxBase { export type JSBAndOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSBAndOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -7039,29 +6901,10 @@ export interface JSBNotOp extends SyntaxBase { export type JSBNotOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSBNotOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -7108,29 +6951,10 @@ export interface JSNotOp extends SyntaxBase { export type JSNotOpParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression | never export type JSNotOpAnyParent = BoltQuoteExpression -| JSBinaryExpression -| JSUnaryExpression -| JSMemberExpression -| JSCallExpression -| JSNewExpression -| JSSequenceExpression -| JSConditionalExpression -| JSExpressionStatement -| JSConditionalCase -| JSReturnStatement -| JSParameter -| JSArrowFunctionDeclaration -| JSLetDeclaration -| JSCatchBlock -| JSTryCatchStatement -| JSSourceFile -| JSFunctionDeclaration | BoltTypeOfExpression | BoltLiftedTypeExpression | BoltExpressionPattern @@ -7445,7 +7269,7 @@ export type JSUnaryExpressionChild export interface JSNewExpression extends SyntaxBase { kind: SyntaxKind.JSNewExpression; target: JSExpression; - arguments: JSExpression[]; + args: JSExpression[]; parentNode: JSNewExpressionParent; getChildNodes(): IterableIterator } @@ -8127,6 +7951,7 @@ export type Syntax | JSFunctionKeyword | JSWhileKeyword | JSForKeyword + | JSOperator | JSCloseBrace | JSCloseBracket | JSCloseParen @@ -8220,10 +8045,10 @@ export function createBoltImplKeyword(span?: TextSpan | null): BoltImplKeyword; export function createBoltParenthesized(text: string, span?: TextSpan | null): BoltParenthesized; export function createBoltBraced(text: string, span?: TextSpan | null): BoltBraced; export function createBoltBracketed(text: string, span?: TextSpan | null): BoltBracketed; -export function createBoltSourceFile(elements: BoltSourceElement[], package: Package, span?: TextSpan | null): BoltSourceFile; +export function createBoltSourceFile(elements: BoltSourceElement[], pkg: Package, span?: TextSpan | null): BoltSourceFile; export function createBoltQualName(isAbsolute: boolean, modulePath: BoltIdentifier[], name: BoltSymbol, span?: TextSpan | null): BoltQualName; export function createBoltTypeOfExpression(expression: BoltExpression, span?: TextSpan | null): BoltTypeOfExpression; -export function createBoltReferenceTypeExpression(name: BoltQualName, arguments: BoltTypeExpression[] | null, span?: TextSpan | null): BoltReferenceTypeExpression; +export function createBoltReferenceTypeExpression(name: BoltQualName, typeArgs: BoltTypeExpression[] | null, span?: TextSpan | null): BoltReferenceTypeExpression; export function createBoltFunctionTypeExpression(params: BoltParameter[], returnType: BoltTypeExpression | null, span?: TextSpan | null): BoltFunctionTypeExpression; export function createBoltLiftedTypeExpression(expression: BoltExpression, span?: TextSpan | null): BoltLiftedTypeExpression; export function createBoltTypeParameter(index: number, name: BoltIdentifier, typeExpr: BoltTypeExpression | null, defaultType: BoltTypeExpression | null, span?: TextSpan | null): BoltTypeParameter; @@ -8261,8 +8086,8 @@ export function createBoltImportDirective(modifiers: BoltModifiers, file: BoltSt export function createBoltExportSymbol(span?: TextSpan | null): BoltExportSymbol; export function createBoltPlainExportSymbol(local: BoltQualName, remote: BoltSymbol, span?: TextSpan | null): BoltPlainExportSymbol; export function createBoltExportDirective(file: string, symbols: BoltExportSymbol[] | null, span?: TextSpan | null): BoltExportDirective; -export function createBoltTraitDeclaration(modifiers: BoltModifiers, name: BoltIdentifier, typeParams: BoltTypeParameter[] | null, elements: BoltDeclaration[], span?: TextSpan | null): BoltTraitDeclaration; -export function createBoltImplDeclaration(modifiers: BoltModifiers, name: BoltIdentifier, trait: BoltTypeExpression, typeParams: BoltTypeParameter[] | null, elements: BoltDeclaration[], span?: TextSpan | null): BoltImplDeclaration; +export function createBoltTraitDeclaration(modifiers: BoltModifiers, typeParams: BoltTypeParameter[] | null, name: BoltIdentifier, typeBoundExpr: BoltTypeExpression | null, elements: BoltDeclaration[] | null, span?: TextSpan | null): BoltTraitDeclaration; +export function createBoltImplDeclaration(modifiers: BoltModifiers, typeParams: BoltTypeParameter[] | null, name: BoltIdentifier, traitTypeExpr: BoltTypeExpression | null, elements: BoltDeclaration[], span?: TextSpan | null): BoltImplDeclaration; export function createBoltTypeAliasDeclaration(modifiers: BoltModifiers, name: BoltIdentifier, typeParams: BoltTypeParameter[] | null, typeExpr: BoltTypeExpression, span?: TextSpan | null): BoltTypeAliasDeclaration; export function createBoltRecordField(name: BoltIdentifier, typeExpr: BoltTypeExpression, span?: TextSpan | null): BoltRecordField; export function createBoltRecordDeclaration(modifiers: BoltModifiers, name: BoltIdentifier, typeParms: BoltTypeParameter[] | null, members: BoltRecordMember[] | null, span?: TextSpan | null): BoltRecordDeclaration; @@ -8283,6 +8108,7 @@ export function createJSExportKeyword(span?: TextSpan | null): JSExportKeyword; export function createJSFunctionKeyword(span?: TextSpan | null): JSFunctionKeyword; export function createJSWhileKeyword(span?: TextSpan | null): JSWhileKeyword; export function createJSForKeyword(span?: TextSpan | null): JSForKeyword; +export function createJSOperator(text: string, span?: TextSpan | null): JSOperator; export function createJSCloseBrace(span?: TextSpan | null): JSCloseBrace; export function createJSCloseBracket(span?: TextSpan | null): JSCloseBracket; export function createJSCloseParen(span?: TextSpan | null): JSCloseParen; @@ -8310,7 +8136,7 @@ export function createJSMemberExpression(value: JSExpression, property: JSIdenti export function createJSCallExpression(operator: JSExpression, operands: JSExpression[], span?: TextSpan | null): JSCallExpression; export function createJSBinaryExpression(left: JSExpression, operator: JSOperator, right: JSExpression, span?: TextSpan | null): JSBinaryExpression; export function createJSUnaryExpression(operator: JSOperator, operand: JSExpression, span?: TextSpan | null): JSUnaryExpression; -export function createJSNewExpression(target: JSExpression, arguments: JSExpression[], span?: TextSpan | null): JSNewExpression; +export function createJSNewExpression(target: JSExpression, args: JSExpression[], span?: TextSpan | null): JSNewExpression; export function createJSSequenceExpression(expressions: JSExpression[], span?: TextSpan | null): JSSequenceExpression; export function createJSConditionalExpression(test: JSExpression, consequent: JSExpression, alternate: JSExpression, span?: TextSpan | null): JSConditionalExpression; export function createJSLiteralExpression(value: JSValue, span?: TextSpan | null): JSLiteralExpression; @@ -8433,6 +8259,7 @@ export function isBoltImportDirective(value: any): value is BoltImportDirective; export function isBoltExportSymbol(value: any): value is BoltExportSymbol; export function isBoltPlainExportSymbol(value: any): value is BoltPlainExportSymbol; export function isBoltExportDirective(value: any): value is BoltExportDirective; +export function isBoltTraitOrImplElement(value: any): value is BoltTraitOrImplElement; export function isBoltTraitDeclaration(value: any): value is BoltTraitDeclaration; export function isBoltImplDeclaration(value: any): value is BoltImplDeclaration; export function isBoltTypeAliasDeclaration(value: any): value is BoltTypeAliasDeclaration; @@ -8443,7 +8270,6 @@ export function isBoltSourceElement(value: any): value is BoltSourceElement; export function isBoltMacroCall(value: any): value is BoltMacroCall; export function isJSSyntax(value: any): value is JSSyntax; export function isJSToken(value: any): value is JSToken; -export function isJSOperator(value: any): value is JSOperator; export function isJSIdentifier(value: any): value is JSIdentifier; export function isJSString(value: any): value is JSString; export function isJSInteger(value: any): value is JSInteger; @@ -8460,6 +8286,7 @@ export function isJSExportKeyword(value: any): value is JSExportKeyword; export function isJSFunctionKeyword(value: any): value is JSFunctionKeyword; export function isJSWhileKeyword(value: any): value is JSWhileKeyword; export function isJSForKeyword(value: any): value is JSForKeyword; +export function isJSOperatorLike(value: any): value is JSOperatorLike; export function isJSOperator(value: any): value is JSOperator; export function isJSCloseBrace(value: any): value is JSCloseBrace; export function isJSCloseBracket(value: any): value is JSCloseBracket; diff --git a/src/ast.js b/src/ast.js new file mode 100644 index 000000000..fc80cd35a --- /dev/null +++ b/src/ast.js @@ -0,0 +1,4795 @@ + +export class NodeVisitor { + visit(node) { + for (const child of node.preorder()) { + const key = `visit${kindToString(child.kind)}`; + if (this[key] !== undefined) { + this[key](child); + } + } + } +} + +let nextNodeId = 1; + +class SyntaxBase { + + constructor(span) { + this.id = nextNodeId++; + this.errors = []; + this.span = span; + } + + *getChildNodes() { + for (const key of Object.keys(this)) { + if (key === 'span' || key === 'parentNode' || key === 'type') { + continue + } + const value = this[key]; + if (Array.isArray(value)) { + for (const element of value) { + if (isSyntax(element)) { + yield element; + } + } + } else { + if (isSyntax(value)) { + yield value; + } + } + } + } + + visit(visitors) { + const stack = [this]; + while (stack.length > 0) { + const node = stack.pop(); + const kindName = kindToString(node.kind); + const kindNamesToVisit = [kindName, ...NODE_TYPES[kindName].parents]; + for (const visitor of visitors) { + for (const kindName of kindNamesToVisit) { + const key = `visit${kindName}` + if (visitor[key] !== undefined) { + visitor[key](node); + } + } + } + for (const childNode of node.getChildNodes()) { + stack.push(childNode); + } + } + } + + *preorder() { + const stack = [this]; + while (stack.length > 0) { + const node = stack.pop(); + yield node + for (const childNode of node.getChildNodes()) { + stack.push(childNode); + } + } + } + + mayContainKind(kind) { + // TODO + return true; + } + + getParentOfKind(kind) { + let currNode = this.parentNode; + while (currNode !== null) { + if (currNode.kind === kind) { + return currNode; + } + currNode = currNode.parentNode; + } + return null; + } + + *findAllChildrenOfKind(kind) { + for (const node of this.preorder()) { + if (!node.mayContainKind(kind)) { + break; + } + if (node.kind === kind) { + yield node + } + } + } + +} + +export function isSyntax(value) { + return typeof value === 'object' + && value !== null + && value.__NODE_TYPE !== undefined; +} + +export function setParents(node, parentNode = null) { + node.parentNode = parentNode; + for (const child of node.getChildNodes()) { + setParents(child, node) + } +} +class EndOfFile extends SyntaxBase { + + static kind = 0; + + static parents = [ + "BoltToken", + "JSToken", + "JSSyntax", + "Token", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltStringLiteral extends SyntaxBase { + + static kind = 7; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltIntegerLiteral extends SyntaxBase { + + static kind = 8; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltIdentifier extends SyntaxBase { + + static kind = 10; + + static parents = [ + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class BoltOperator extends SyntaxBase { + + static kind = 12; + + static parents = [ + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class BoltAssignment extends SyntaxBase { + + static kind = 13; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + operator, + span = null, + ) { + super(span); + this.operator = operator; + this.span = span + } + +} +class BoltComma extends SyntaxBase { + + static kind = 14; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltSemi extends SyntaxBase { + + static kind = 15; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltColon extends SyntaxBase { + + static kind = 16; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltColonColon extends SyntaxBase { + + static kind = 17; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltDot extends SyntaxBase { + + static kind = 18; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltDotDot extends SyntaxBase { + + static kind = 19; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltRArrow extends SyntaxBase { + + static kind = 20; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltRArrowAlt extends SyntaxBase { + + static kind = 21; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltLArrow extends SyntaxBase { + + static kind = 22; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltEqSign extends SyntaxBase { + + static kind = 23; + + static parents = [ + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltGtSign extends SyntaxBase { + + static kind = 24; + + static parents = [ + "BoltToken", + "BoltOperatorLike", + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltExMark extends SyntaxBase { + + static kind = 25; + + static parents = [ + "BoltToken", + "BoltOperatorLike", + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltLtSign extends SyntaxBase { + + static kind = 26; + + static parents = [ + "BoltToken", + "BoltOperatorLike", + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltVBar extends SyntaxBase { + + static kind = 27; + + static parents = [ + "BoltToken", + "BoltOperatorLike", + "BoltSymbol", + "BoltToken", + "Token", + "BoltSyntax", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltWhereKeyword extends SyntaxBase { + + static kind = 29; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltQuoteKeyword extends SyntaxBase { + + static kind = 30; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltFnKeyword extends SyntaxBase { + + static kind = 31; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltForeignKeyword extends SyntaxBase { + + static kind = 32; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltForKeyword extends SyntaxBase { + + static kind = 33; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltLetKeyword extends SyntaxBase { + + static kind = 34; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltReturnKeyword extends SyntaxBase { + + static kind = 35; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltLoopKeyword extends SyntaxBase { + + static kind = 36; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltYieldKeyword extends SyntaxBase { + + static kind = 37; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltMatchKeyword extends SyntaxBase { + + static kind = 38; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltImportKeyword extends SyntaxBase { + + static kind = 39; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltExportKeyword extends SyntaxBase { + + static kind = 40; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltPubKeyword extends SyntaxBase { + + static kind = 41; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltModKeyword extends SyntaxBase { + + static kind = 42; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltMutKeyword extends SyntaxBase { + + static kind = 43; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltEnumKeyword extends SyntaxBase { + + static kind = 44; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltStructKeyword extends SyntaxBase { + + static kind = 45; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltTypeKeyword extends SyntaxBase { + + static kind = 46; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltTraitKeyword extends SyntaxBase { + + static kind = 47; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltImplKeyword extends SyntaxBase { + + static kind = 48; + + static parents = [ + "BoltToken", + "BoltKeyword", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltParenthesized extends SyntaxBase { + + static kind = 50; + + static parents = [ + "BoltPunctuated", + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class BoltBraced extends SyntaxBase { + + static kind = 51; + + static parents = [ + "BoltPunctuated", + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class BoltBracketed extends SyntaxBase { + + static kind = 52; + + static parents = [ + "BoltPunctuated", + "BoltToken", + "Token", + "BoltSyntax", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class BoltSourceFile extends SyntaxBase { + + static kind = 53; + + static parents = [ + "BoltSyntax", + "SourceFile", + "Syntax" + ]; + + constructor( + elements, + pkg, + span = null, + ) { + super(span); + this.elements = elements; + this.pkg = pkg; + this.span = span + } + +} +class BoltQualName extends SyntaxBase { + + static kind = 54; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + isAbsolute, + modulePath, + name, + span = null, + ) { + super(span); + this.isAbsolute = isAbsolute; + this.modulePath = modulePath; + this.name = name; + this.span = span + } + +} +class BoltTypeOfExpression extends SyntaxBase { + + static kind = 56; + + static parents = [ + "BoltTypeExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + expression, + span = null, + ) { + super(span); + this.expression = expression; + this.span = span + } + +} +class BoltReferenceTypeExpression extends SyntaxBase { + + static kind = 57; + + static parents = [ + "BoltTypeExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + typeArgs, + span = null, + ) { + super(span); + this.name = name; + this.typeArgs = typeArgs; + this.span = span + } + +} +class BoltFunctionTypeExpression extends SyntaxBase { + + static kind = 58; + + static parents = [ + "BoltTypeExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + params, + returnType, + span = null, + ) { + super(span); + this.params = params; + this.returnType = returnType; + this.span = span + } + +} +class BoltLiftedTypeExpression extends SyntaxBase { + + static kind = 59; + + static parents = [ + "BoltTypeExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + expression, + span = null, + ) { + super(span); + this.expression = expression; + this.span = span + } + +} +class BoltTypeParameter extends SyntaxBase { + + static kind = 60; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + index, + name, + typeExpr, + defaultType, + span = null, + ) { + super(span); + this.index = index; + this.name = name; + this.typeExpr = typeExpr; + this.defaultType = defaultType; + this.span = span + } + +} +class BoltBindPattern extends SyntaxBase { + + static kind = 62; + + static parents = [ + "BoltPattern", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + span = null, + ) { + super(span); + this.name = name; + this.span = span + } + +} +class BoltTypePattern extends SyntaxBase { + + static kind = 63; + + static parents = [ + "BoltPattern", + "BoltSyntax", + "Syntax" + ]; + + constructor( + typeExpr, + nestedPattern, + span = null, + ) { + super(span); + this.typeExpr = typeExpr; + this.nestedPattern = nestedPattern; + this.span = span + } + +} +class BoltExpressionPattern extends SyntaxBase { + + static kind = 64; + + static parents = [ + "BoltPattern", + "BoltSyntax", + "Syntax" + ]; + + constructor( + expression, + span = null, + ) { + super(span); + this.expression = expression; + this.span = span + } + +} +class BoltTuplePatternElement extends SyntaxBase { + + static kind = 65; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + index, + pattern, + span = null, + ) { + super(span); + this.index = index; + this.pattern = pattern; + this.span = span + } + +} +class BoltTuplePattern extends SyntaxBase { + + static kind = 66; + + static parents = [ + "BoltPattern", + "BoltSyntax", + "Syntax" + ]; + + constructor( + elements, + span = null, + ) { + super(span); + this.elements = elements; + this.span = span + } + +} +class BoltRecordFieldPattern extends SyntaxBase { + + static kind = 67; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + isRest, + name, + pattern, + span = null, + ) { + super(span); + this.isRest = isRest; + this.name = name; + this.pattern = pattern; + this.span = span + } + +} +class BoltRecordPattern extends SyntaxBase { + + static kind = 68; + + static parents = [ + "BoltPattern", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + fields, + span = null, + ) { + super(span); + this.name = name; + this.fields = fields; + this.span = span + } + +} +class BoltQuoteExpression extends SyntaxBase { + + static kind = 70; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + tokens, + span = null, + ) { + super(span); + this.tokens = tokens; + this.span = span + } + +} +class BoltTupleExpression extends SyntaxBase { + + static kind = 71; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + elements, + span = null, + ) { + super(span); + this.elements = elements; + this.span = span + } + +} +class BoltReferenceExpression extends SyntaxBase { + + static kind = 72; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + span = null, + ) { + super(span); + this.name = name; + this.span = span + } + +} +class BoltMemberExpression extends SyntaxBase { + + static kind = 73; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + expression, + path, + span = null, + ) { + super(span); + this.expression = expression; + this.path = path; + this.span = span + } + +} +class BoltFunctionExpression extends SyntaxBase { + + static kind = 74; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + params, + returnType, + body, + span = null, + ) { + super(span); + this.params = params; + this.returnType = returnType; + this.body = body; + this.span = span + } + +} +class BoltCallExpression extends SyntaxBase { + + static kind = 75; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + operator, + operands, + span = null, + ) { + super(span); + this.operator = operator; + this.operands = operands; + this.span = span + } + +} +class BoltYieldExpression extends SyntaxBase { + + static kind = 76; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltMatchArm extends SyntaxBase { + + static kind = 77; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + pattern, + body, + span = null, + ) { + super(span); + this.pattern = pattern; + this.body = body; + this.span = span + } + +} +class BoltMatchExpression extends SyntaxBase { + + static kind = 78; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + value, + arms, + span = null, + ) { + super(span); + this.value = value; + this.arms = arms; + this.span = span + } + +} +class BoltCase extends SyntaxBase { + + static kind = 79; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + test, + result, + span = null, + ) { + super(span); + this.test = test; + this.result = result; + this.span = span + } + +} +class BoltCaseExpression extends SyntaxBase { + + static kind = 80; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + cases, + span = null, + ) { + super(span); + this.cases = cases; + this.span = span + } + +} +class BoltBlockExpression extends SyntaxBase { + + static kind = 81; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + elements, + span = null, + ) { + super(span); + this.elements = elements; + this.span = span + } + +} +class BoltConstantExpression extends SyntaxBase { + + static kind = 82; + + static parents = [ + "BoltExpression", + "BoltSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltReturnStatement extends SyntaxBase { + + static kind = 84; + + static parents = [ + "ReturnStatement", + "BoltStatement", + "BoltSyntax", + "BoltFunctionBodyElement", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltConditionalCase extends SyntaxBase { + + static kind = 85; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + test, + body, + span = null, + ) { + super(span); + this.test = test; + this.body = body; + this.span = span + } + +} +class BoltConditionalStatement extends SyntaxBase { + + static kind = 86; + + static parents = [ + "BoltStatement", + "BoltSyntax", + "BoltFunctionBodyElement", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + cases, + span = null, + ) { + super(span); + this.cases = cases; + this.span = span + } + +} +class BoltResumeStatement extends SyntaxBase { + + static kind = 87; + + static parents = [ + "BoltStatement", + "BoltSyntax", + "BoltFunctionBodyElement", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class BoltExpressionStatement extends SyntaxBase { + + static kind = 88; + + static parents = [ + "BoltStatement", + "BoltSyntax", + "BoltFunctionBodyElement", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + expression, + span = null, + ) { + super(span); + this.expression = expression; + this.span = span + } + +} +class BoltParameter extends SyntaxBase { + + static kind = 89; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + index, + bindings, + typeExpr, + defaultValue, + span = null, + ) { + super(span); + this.index = index; + this.bindings = bindings; + this.typeExpr = typeExpr; + this.defaultValue = defaultValue; + this.span = span + } + +} +class BoltModule extends SyntaxBase { + + static kind = 93; + + static parents = [ + "BoltSyntax", + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + name, + elements, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.name = name; + this.elements = elements; + this.span = span + } + +} +class BoltFunctionDeclaration extends SyntaxBase { + + static kind = 96; + + static parents = [ + "BoltFunctionBodyElement", + "BoltDeclaration", + "BoltDeclarationLike", + "BoltTraitOrImplElement", + "BoltSyntax", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + modifiers, + target, + name, + params, + returnType, + typeParams, + body, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.target = target; + this.name = name; + this.params = params; + this.returnType = returnType; + this.typeParams = typeParams; + this.body = body; + this.span = span + } + +} +class BoltVariableDeclaration extends SyntaxBase { + + static kind = 97; + + static parents = [ + "BoltFunctionBodyElement", + "BoltDeclaration", + "BoltDeclarationLike", + "BoltSyntax", + "BoltSourceElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + modifiers, + bindings, + typeExpr, + value, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.bindings = bindings; + this.typeExpr = typeExpr; + this.value = value; + this.span = span + } + +} +class BoltPlainImportSymbol extends SyntaxBase { + + static kind = 99; + + static parents = [ + "BoltImportSymbol", + "BoltSyntax", + "Syntax" + ]; + + constructor( + remote, + local, + span = null, + ) { + super(span); + this.remote = remote; + this.local = local; + this.span = span + } + +} +class BoltImportDirective extends SyntaxBase { + + static kind = 100; + + static parents = [ + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + file, + symbols, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.file = file; + this.symbols = symbols; + this.span = span + } + +} +class BoltExportSymbol extends SyntaxBase { + + static kind = 101; + + static parents = [ + "BoltSyntax", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class BoltPlainExportSymbol extends SyntaxBase { + + static kind = 102; + + static parents = [ + "Syntax" + ]; + + constructor( + local, + remote, + span = null, + ) { + super(span); + this.local = local; + this.remote = remote; + this.span = span + } + +} +class BoltExportDirective extends SyntaxBase { + + static kind = 103; + + static parents = [ + "BoltSourceElement", + "Syntax" + ]; + + constructor( + file, + symbols, + span = null, + ) { + super(span); + this.file = file; + this.symbols = symbols; + this.span = span + } + +} +class BoltTraitDeclaration extends SyntaxBase { + + static kind = 105; + + static parents = [ + "BoltDeclarationLike", + "BoltTypeDeclaration", + "BoltSyntax", + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + typeParams, + name, + typeBoundExpr, + elements, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.typeParams = typeParams; + this.name = name; + this.typeBoundExpr = typeBoundExpr; + this.elements = elements; + this.span = span + } + +} +class BoltImplDeclaration extends SyntaxBase { + + static kind = 106; + + static parents = [ + "BoltTypeDeclaration", + "BoltDeclarationLike", + "BoltSyntax", + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + typeParams, + name, + traitTypeExpr, + elements, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.typeParams = typeParams; + this.name = name; + this.traitTypeExpr = traitTypeExpr; + this.elements = elements; + this.span = span + } + +} +class BoltTypeAliasDeclaration extends SyntaxBase { + + static kind = 107; + + static parents = [ + "BoltDeclarationLike", + "BoltTypeDeclaration", + "BoltTraitOrImplElement", + "BoltSyntax", + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + name, + typeParams, + typeExpr, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.name = name; + this.typeParams = typeParams; + this.typeExpr = typeExpr; + this.span = span + } + +} +class BoltRecordField extends SyntaxBase { + + static kind = 109; + + static parents = [ + "BoltRecordMember", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + typeExpr, + span = null, + ) { + super(span); + this.name = name; + this.typeExpr = typeExpr; + this.span = span + } + +} +class BoltRecordDeclaration extends SyntaxBase { + + static kind = 110; + + static parents = [ + "BoltDeclaration", + "BoltTypeDeclaration", + "BoltDeclarationLike", + "BoltSyntax", + "BoltSourceElement", + "BoltSyntax", + "BoltSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + name, + typeParms, + members, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.name = name; + this.typeParms = typeParms; + this.members = members; + this.span = span + } + +} +class BoltMacroCall extends SyntaxBase { + + static kind = 112; + + static parents = [ + "BoltRecordMember", + "BoltSourceElement", + "BoltTraitOrImplElement", + "BoltFunctionBodyElement", + "FunctionBodyElement", + "BoltSyntax", + "Syntax" + ]; + + constructor( + name, + text, + span = null, + ) { + super(span); + this.name = name; + this.text = text; + this.span = span + } + +} +class JSIdentifier extends SyntaxBase { + + static kind = 115; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class JSString extends SyntaxBase { + + static kind = 116; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class JSInteger extends SyntaxBase { + + static kind = 117; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class JSFromKeyword extends SyntaxBase { + + static kind = 118; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSReturnKeyword extends SyntaxBase { + + static kind = 119; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSTryKeyword extends SyntaxBase { + + static kind = 120; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSFinallyKeyword extends SyntaxBase { + + static kind = 121; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSCatchKeyword extends SyntaxBase { + + static kind = 122; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSImportKeyword extends SyntaxBase { + + static kind = 123; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSAsKeyword extends SyntaxBase { + + static kind = 124; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSConstKeyword extends SyntaxBase { + + static kind = 125; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSLetKeyword extends SyntaxBase { + + static kind = 126; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSExportKeyword extends SyntaxBase { + + static kind = 127; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSFunctionKeyword extends SyntaxBase { + + static kind = 128; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSWhileKeyword extends SyntaxBase { + + static kind = 129; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSForKeyword extends SyntaxBase { + + static kind = 130; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSOperator extends SyntaxBase { + + static kind = 132; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + text, + span = null, + ) { + super(span); + this.text = text; + this.span = span + } + +} +class JSCloseBrace extends SyntaxBase { + + static kind = 133; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSCloseBracket extends SyntaxBase { + + static kind = 134; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSCloseParen extends SyntaxBase { + + static kind = 135; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSOpenBrace extends SyntaxBase { + + static kind = 136; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSOpenBracket extends SyntaxBase { + + static kind = 137; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSOpenParen extends SyntaxBase { + + static kind = 138; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSSemi extends SyntaxBase { + + static kind = 139; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSComma extends SyntaxBase { + + static kind = 140; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSDot extends SyntaxBase { + + static kind = 141; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSDotDotDot extends SyntaxBase { + + static kind = 142; + + static parents = [ + "JSToken", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSMulOp extends SyntaxBase { + + static kind = 143; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSAddOp extends SyntaxBase { + + static kind = 144; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSDivOp extends SyntaxBase { + + static kind = 145; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSSubOp extends SyntaxBase { + + static kind = 146; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSLtOp extends SyntaxBase { + + static kind = 147; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSGtOp extends SyntaxBase { + + static kind = 148; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSBOrOp extends SyntaxBase { + + static kind = 149; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSBXorOp extends SyntaxBase { + + static kind = 150; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSBAndOp extends SyntaxBase { + + static kind = 151; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSBNotOp extends SyntaxBase { + + static kind = 152; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSNotOp extends SyntaxBase { + + static kind = 153; + + static parents = [ + "JSToken", + "JSOperatorLike", + "JSSyntax", + "Token", + "Syntax" + ]; + + constructor( + span = null, + ) { + super(span); + this.span = span + } + +} +class JSBindPattern extends SyntaxBase { + + static kind = 155; + + static parents = [ + "JSPattern", + "JSSyntax", + "Syntax" + ]; + + constructor( + name, + span = null, + ) { + super(span); + this.name = name; + this.span = span + } + +} +class JSConstantExpression extends SyntaxBase { + + static kind = 157; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class JSMemberExpression extends SyntaxBase { + + static kind = 158; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + value, + property, + span = null, + ) { + super(span); + this.value = value; + this.property = property; + this.span = span + } + +} +class JSCallExpression extends SyntaxBase { + + static kind = 159; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + operator, + operands, + span = null, + ) { + super(span); + this.operator = operator; + this.operands = operands; + this.span = span + } + +} +class JSBinaryExpression extends SyntaxBase { + + static kind = 160; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + left, + operator, + right, + span = null, + ) { + super(span); + this.left = left; + this.operator = operator; + this.right = right; + this.span = span + } + +} +class JSUnaryExpression extends SyntaxBase { + + static kind = 161; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + operator, + operand, + span = null, + ) { + super(span); + this.operator = operator; + this.operand = operand; + this.span = span + } + +} +class JSNewExpression extends SyntaxBase { + + static kind = 162; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + target, + args, + span = null, + ) { + super(span); + this.target = target; + this.args = args; + this.span = span + } + +} +class JSSequenceExpression extends SyntaxBase { + + static kind = 163; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + expressions, + span = null, + ) { + super(span); + this.expressions = expressions; + this.span = span + } + +} +class JSConditionalExpression extends SyntaxBase { + + static kind = 164; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + test, + consequent, + alternate, + span = null, + ) { + super(span); + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + this.span = span + } + +} +class JSLiteralExpression extends SyntaxBase { + + static kind = 165; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class JSReferenceExpression extends SyntaxBase { + + static kind = 166; + + static parents = [ + "JSExpression", + "JSSyntax", + "Syntax" + ]; + + constructor( + name, + span = null, + ) { + super(span); + this.name = name; + this.span = span + } + +} +class JSCatchBlock extends SyntaxBase { + + static kind = 170; + + static parents = [ + "JSSyntax", + "Syntax" + ]; + + constructor( + bindings, + elements, + span = null, + ) { + super(span); + this.bindings = bindings; + this.elements = elements; + this.span = span + } + +} +class JSTryCatchStatement extends SyntaxBase { + + static kind = 171; + + static parents = [ + "JSSyntax", + "Syntax" + ]; + + constructor( + tryBlock, + catchBlock, + finalBlock, + span = null, + ) { + super(span); + this.tryBlock = tryBlock; + this.catchBlock = catchBlock; + this.finalBlock = finalBlock; + this.span = span + } + +} +class JSExpressionStatement extends SyntaxBase { + + static kind = 172; + + static parents = [ + "JSStatement", + "JSSyntax", + "JSSourceElement", + "JSFunctionBodyElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + expression, + span = null, + ) { + super(span); + this.expression = expression; + this.span = span + } + +} +class JSConditionalCase extends SyntaxBase { + + static kind = 173; + + static parents = [ + "JSSyntax", + "Syntax" + ]; + + constructor( + test, + body, + span = null, + ) { + super(span); + this.test = test; + this.body = body; + this.span = span + } + +} +class JSConditionalStatement extends SyntaxBase { + + static kind = 174; + + static parents = [ + "JSStatement", + "JSSyntax", + "JSSourceElement", + "JSFunctionBodyElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + cases, + span = null, + ) { + super(span); + this.cases = cases; + this.span = span + } + +} +class JSReturnStatement extends SyntaxBase { + + static kind = 175; + + static parents = [ + "ReturnStatement", + "JSStatement", + "JSSyntax", + "JSSourceElement", + "JSFunctionBodyElement", + "FunctionBodyElement", + "Syntax" + ]; + + constructor( + value, + span = null, + ) { + super(span); + this.value = value; + this.span = span + } + +} +class JSParameter extends SyntaxBase { + + static kind = 176; + + static parents = [ + "JSSyntax", + "Syntax" + ]; + + constructor( + index, + bindings, + defaultValue, + span = null, + ) { + super(span); + this.index = index; + this.bindings = bindings; + this.defaultValue = defaultValue; + this.span = span + } + +} +class JSImportStarBinding extends SyntaxBase { + + static kind = 180; + + static parents = [ + "JSImportBinding", + "JSSyntax", + "Syntax" + ]; + + constructor( + local, + span = null, + ) { + super(span); + this.local = local; + this.span = span + } + +} +class JSImportAsBinding extends SyntaxBase { + + static kind = 181; + + static parents = [ + "JSImportBinding", + "JSSyntax", + "Syntax" + ]; + + constructor( + remote, + local, + span = null, + ) { + super(span); + this.remote = remote; + this.local = local; + this.span = span + } + +} +class JSImportDeclaration extends SyntaxBase { + + static kind = 182; + + static parents = [ + "JSDeclaration", + "JSSyntax", + "JSSourceElement", + "Syntax" + ]; + + constructor( + bindings, + filename, + span = null, + ) { + super(span); + this.bindings = bindings; + this.filename = filename; + this.span = span + } + +} +class JSFunctionDeclaration extends SyntaxBase { + + static kind = 183; + + static parents = [ + "JSDeclaration", + "JSFunctionBodyElement", + "FunctionBodyElement", + "JSSyntax", + "JSSourceElement", + "Syntax" + ]; + + constructor( + modifiers, + name, + params, + body, + span = null, + ) { + super(span); + this.modifiers = modifiers; + this.name = name; + this.params = params; + this.body = body; + this.span = span + } + +} +class JSArrowFunctionDeclaration extends SyntaxBase { + + static kind = 184; + + static parents = [ + "JSDeclaration", + "JSFunctionBodyElement", + "FunctionBodyElement", + "JSSyntax", + "JSSourceElement", + "Syntax" + ]; + + constructor( + name, + params, + body, + span = null, + ) { + super(span); + this.name = name; + this.params = params; + this.body = body; + this.span = span + } + +} +class JSLetDeclaration extends SyntaxBase { + + static kind = 185; + + static parents = [ + "JSDeclaration", + "JSFunctionBodyElement", + "FunctionBodyElement", + "JSSyntax", + "JSSourceElement", + "Syntax" + ]; + + constructor( + bindings, + value, + span = null, + ) { + super(span); + this.bindings = bindings; + this.value = value; + this.span = span + } + +} +class JSSourceFile extends SyntaxBase { + + static kind = 186; + + static parents = [ + "JSSyntax", + "SourceFile", + "Syntax" + ]; + + constructor( + elements, + span = null, + ) { + super(span); + this.elements = elements; + this.span = span + } + +} +const NODE_CLASSES = { + EndOfFile, + BoltStringLiteral, + BoltIntegerLiteral, + BoltIdentifier, + BoltOperator, + BoltAssignment, + BoltComma, + BoltSemi, + BoltColon, + BoltColonColon, + BoltDot, + BoltDotDot, + BoltRArrow, + BoltRArrowAlt, + BoltLArrow, + BoltEqSign, + BoltGtSign, + BoltExMark, + BoltLtSign, + BoltVBar, + BoltWhereKeyword, + BoltQuoteKeyword, + BoltFnKeyword, + BoltForeignKeyword, + BoltForKeyword, + BoltLetKeyword, + BoltReturnKeyword, + BoltLoopKeyword, + BoltYieldKeyword, + BoltMatchKeyword, + BoltImportKeyword, + BoltExportKeyword, + BoltPubKeyword, + BoltModKeyword, + BoltMutKeyword, + BoltEnumKeyword, + BoltStructKeyword, + BoltTypeKeyword, + BoltTraitKeyword, + BoltImplKeyword, + BoltParenthesized, + BoltBraced, + BoltBracketed, + BoltSourceFile, + BoltQualName, + BoltTypeOfExpression, + BoltReferenceTypeExpression, + BoltFunctionTypeExpression, + BoltLiftedTypeExpression, + BoltTypeParameter, + BoltBindPattern, + BoltTypePattern, + BoltExpressionPattern, + BoltTuplePatternElement, + BoltTuplePattern, + BoltRecordFieldPattern, + BoltRecordPattern, + BoltQuoteExpression, + BoltTupleExpression, + BoltReferenceExpression, + BoltMemberExpression, + BoltFunctionExpression, + BoltCallExpression, + BoltYieldExpression, + BoltMatchArm, + BoltMatchExpression, + BoltCase, + BoltCaseExpression, + BoltBlockExpression, + BoltConstantExpression, + BoltReturnStatement, + BoltConditionalCase, + BoltConditionalStatement, + BoltResumeStatement, + BoltExpressionStatement, + BoltParameter, + BoltModule, + BoltFunctionDeclaration, + BoltVariableDeclaration, + BoltPlainImportSymbol, + BoltImportDirective, + BoltExportSymbol, + BoltPlainExportSymbol, + BoltExportDirective, + BoltTraitDeclaration, + BoltImplDeclaration, + BoltTypeAliasDeclaration, + BoltRecordField, + BoltRecordDeclaration, + BoltMacroCall, + JSIdentifier, + JSString, + JSInteger, + JSFromKeyword, + JSReturnKeyword, + JSTryKeyword, + JSFinallyKeyword, + JSCatchKeyword, + JSImportKeyword, + JSAsKeyword, + JSConstKeyword, + JSLetKeyword, + JSExportKeyword, + JSFunctionKeyword, + JSWhileKeyword, + JSForKeyword, + JSOperator, + JSCloseBrace, + JSCloseBracket, + JSCloseParen, + JSOpenBrace, + JSOpenBracket, + JSOpenParen, + JSSemi, + JSComma, + JSDot, + JSDotDotDot, + JSMulOp, + JSAddOp, + JSDivOp, + JSSubOp, + JSLtOp, + JSGtOp, + JSBOrOp, + JSBXorOp, + JSBAndOp, + JSBNotOp, + JSNotOp, + JSBindPattern, + JSConstantExpression, + JSMemberExpression, + JSCallExpression, + JSBinaryExpression, + JSUnaryExpression, + JSNewExpression, + JSSequenceExpression, + JSConditionalExpression, + JSLiteralExpression, + JSReferenceExpression, + JSCatchBlock, + JSTryCatchStatement, + JSExpressionStatement, + JSConditionalCase, + JSConditionalStatement, + JSReturnStatement, + JSParameter, + JSImportStarBinding, + JSImportAsBinding, + JSImportDeclaration, + JSFunctionDeclaration, + JSArrowFunctionDeclaration, + JSLetDeclaration, + JSSourceFile, +} + +export function kindToString (kind) { + switch (kind) { + case 0: return 'EndOfFile'; + case 7: return 'BoltStringLiteral'; + case 8: return 'BoltIntegerLiteral'; + case 10: return 'BoltIdentifier'; + case 12: return 'BoltOperator'; + case 13: return 'BoltAssignment'; + case 14: return 'BoltComma'; + case 15: return 'BoltSemi'; + case 16: return 'BoltColon'; + case 17: return 'BoltColonColon'; + case 18: return 'BoltDot'; + case 19: return 'BoltDotDot'; + case 20: return 'BoltRArrow'; + case 21: return 'BoltRArrowAlt'; + case 22: return 'BoltLArrow'; + case 23: return 'BoltEqSign'; + case 24: return 'BoltGtSign'; + case 25: return 'BoltExMark'; + case 26: return 'BoltLtSign'; + case 27: return 'BoltVBar'; + case 29: return 'BoltWhereKeyword'; + case 30: return 'BoltQuoteKeyword'; + case 31: return 'BoltFnKeyword'; + case 32: return 'BoltForeignKeyword'; + case 33: return 'BoltForKeyword'; + case 34: return 'BoltLetKeyword'; + case 35: return 'BoltReturnKeyword'; + case 36: return 'BoltLoopKeyword'; + case 37: return 'BoltYieldKeyword'; + case 38: return 'BoltMatchKeyword'; + case 39: return 'BoltImportKeyword'; + case 40: return 'BoltExportKeyword'; + case 41: return 'BoltPubKeyword'; + case 42: return 'BoltModKeyword'; + case 43: return 'BoltMutKeyword'; + case 44: return 'BoltEnumKeyword'; + case 45: return 'BoltStructKeyword'; + case 46: return 'BoltTypeKeyword'; + case 47: return 'BoltTraitKeyword'; + case 48: return 'BoltImplKeyword'; + case 50: return 'BoltParenthesized'; + case 51: return 'BoltBraced'; + case 52: return 'BoltBracketed'; + case 53: return 'BoltSourceFile'; + case 54: return 'BoltQualName'; + case 56: return 'BoltTypeOfExpression'; + case 57: return 'BoltReferenceTypeExpression'; + case 58: return 'BoltFunctionTypeExpression'; + case 59: return 'BoltLiftedTypeExpression'; + case 60: return 'BoltTypeParameter'; + case 62: return 'BoltBindPattern'; + case 63: return 'BoltTypePattern'; + case 64: return 'BoltExpressionPattern'; + case 65: return 'BoltTuplePatternElement'; + case 66: return 'BoltTuplePattern'; + case 67: return 'BoltRecordFieldPattern'; + case 68: return 'BoltRecordPattern'; + case 70: return 'BoltQuoteExpression'; + case 71: return 'BoltTupleExpression'; + case 72: return 'BoltReferenceExpression'; + case 73: return 'BoltMemberExpression'; + case 74: return 'BoltFunctionExpression'; + case 75: return 'BoltCallExpression'; + case 76: return 'BoltYieldExpression'; + case 77: return 'BoltMatchArm'; + case 78: return 'BoltMatchExpression'; + case 79: return 'BoltCase'; + case 80: return 'BoltCaseExpression'; + case 81: return 'BoltBlockExpression'; + case 82: return 'BoltConstantExpression'; + case 84: return 'BoltReturnStatement'; + case 85: return 'BoltConditionalCase'; + case 86: return 'BoltConditionalStatement'; + case 87: return 'BoltResumeStatement'; + case 88: return 'BoltExpressionStatement'; + case 89: return 'BoltParameter'; + case 93: return 'BoltModule'; + case 96: return 'BoltFunctionDeclaration'; + case 97: return 'BoltVariableDeclaration'; + case 99: return 'BoltPlainImportSymbol'; + case 100: return 'BoltImportDirective'; + case 101: return 'BoltExportSymbol'; + case 102: return 'BoltPlainExportSymbol'; + case 103: return 'BoltExportDirective'; + case 105: return 'BoltTraitDeclaration'; + case 106: return 'BoltImplDeclaration'; + case 107: return 'BoltTypeAliasDeclaration'; + case 109: return 'BoltRecordField'; + case 110: return 'BoltRecordDeclaration'; + case 112: return 'BoltMacroCall'; + case 115: return 'JSIdentifier'; + case 116: return 'JSString'; + case 117: return 'JSInteger'; + case 118: return 'JSFromKeyword'; + case 119: return 'JSReturnKeyword'; + case 120: return 'JSTryKeyword'; + case 121: return 'JSFinallyKeyword'; + case 122: return 'JSCatchKeyword'; + case 123: return 'JSImportKeyword'; + case 124: return 'JSAsKeyword'; + case 125: return 'JSConstKeyword'; + case 126: return 'JSLetKeyword'; + case 127: return 'JSExportKeyword'; + case 128: return 'JSFunctionKeyword'; + case 129: return 'JSWhileKeyword'; + case 130: return 'JSForKeyword'; + case 132: return 'JSOperator'; + case 133: return 'JSCloseBrace'; + case 134: return 'JSCloseBracket'; + case 135: return 'JSCloseParen'; + case 136: return 'JSOpenBrace'; + case 137: return 'JSOpenBracket'; + case 138: return 'JSOpenParen'; + case 139: return 'JSSemi'; + case 140: return 'JSComma'; + case 141: return 'JSDot'; + case 142: return 'JSDotDotDot'; + case 143: return 'JSMulOp'; + case 144: return 'JSAddOp'; + case 145: return 'JSDivOp'; + case 146: return 'JSSubOp'; + case 147: return 'JSLtOp'; + case 148: return 'JSGtOp'; + case 149: return 'JSBOrOp'; + case 150: return 'JSBXorOp'; + case 151: return 'JSBAndOp'; + case 152: return 'JSBNotOp'; + case 153: return 'JSNotOp'; + case 155: return 'JSBindPattern'; + case 157: return 'JSConstantExpression'; + case 158: return 'JSMemberExpression'; + case 159: return 'JSCallExpression'; + case 160: return 'JSBinaryExpression'; + case 161: return 'JSUnaryExpression'; + case 162: return 'JSNewExpression'; + case 163: return 'JSSequenceExpression'; + case 164: return 'JSConditionalExpression'; + case 165: return 'JSLiteralExpression'; + case 166: return 'JSReferenceExpression'; + case 170: return 'JSCatchBlock'; + case 171: return 'JSTryCatchStatement'; + case 172: return 'JSExpressionStatement'; + case 173: return 'JSConditionalCase'; + case 174: return 'JSConditionalStatement'; + case 175: return 'JSReturnStatement'; + case 176: return 'JSParameter'; + case 180: return 'JSImportStarBinding'; + case 181: return 'JSImportAsBinding'; + case 182: return 'JSImportDeclaration'; + case 183: return 'JSFunctionDeclaration'; + case 184: return 'JSArrowFunctionDeclaration'; + case 185: return 'JSLetDeclaration'; + case 186: return 'JSSourceFile'; + } +} + +export function isEndOfFile(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 0; +} +export function isToken(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 0 || value.kind === 115 || value.kind === 116 || value.kind === 117 || value.kind === 118 || value.kind === 119 || value.kind === 120 || value.kind === 121 || value.kind === 122 || value.kind === 123 || value.kind === 124 || value.kind === 125 || value.kind === 126 || value.kind === 127 || value.kind === 128 || value.kind === 129 || value.kind === 130 || value.kind === 132 || value.kind === 133 || value.kind === 134 || value.kind === 135 || value.kind === 136 || value.kind === 137 || value.kind === 138 || value.kind === 139 || value.kind === 140 || value.kind === 141 || value.kind === 142 || value.kind === 143 || value.kind === 144 || value.kind === 145 || value.kind === 146 || value.kind === 147 || value.kind === 148 || value.kind === 149 || value.kind === 150 || value.kind === 151 || value.kind === 152 || value.kind === 153 || value.kind === 0 || value.kind === 7 || value.kind === 8 || value.kind === 13 || value.kind === 14 || value.kind === 15 || value.kind === 16 || value.kind === 17 || value.kind === 18 || value.kind === 19 || value.kind === 20 || value.kind === 21 || value.kind === 22 || value.kind === 23 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 || value.kind === 29 || value.kind === 30 || value.kind === 31 || value.kind === 32 || value.kind === 33 || value.kind === 34 || value.kind === 35 || value.kind === 36 || value.kind === 37 || value.kind === 38 || value.kind === 39 || value.kind === 40 || value.kind === 41 || value.kind === 42 || value.kind === 43 || value.kind === 44 || value.kind === 45 || value.kind === 46 || value.kind === 47 || value.kind === 48 || value.kind === 50 || value.kind === 51 || value.kind === 52 || value.kind === 10 || value.kind === 12 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 +} +export function isSourceFile(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 53 || value.kind === 186 +} +export function isFunctionBodyElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 183 || value.kind === 184 || value.kind === 185 || value.kind === 172 || value.kind === 174 || value.kind === 175 || value.kind === 96 || value.kind === 97 || value.kind === 112 || value.kind === 84 || value.kind === 86 || value.kind === 87 || value.kind === 88 +} +export function isReturnStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 84 || value.kind === 175 +} +export function isBoltSyntax(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 53 || value.kind === 54 || value.kind === 60 || value.kind === 65 || value.kind === 67 || value.kind === 77 || value.kind === 79 || value.kind === 85 || value.kind === 89 || value.kind === 93 || value.kind === 101 || value.kind === 109 || value.kind === 112 || value.kind === 99 || value.kind === 105 || value.kind === 106 || value.kind === 107 || value.kind === 110 || value.kind === 96 || value.kind === 97 || value.kind === 110 || value.kind === 84 || value.kind === 86 || value.kind === 87 || value.kind === 88 || value.kind === 70 || value.kind === 71 || value.kind === 72 || value.kind === 73 || value.kind === 74 || value.kind === 75 || value.kind === 76 || value.kind === 78 || value.kind === 80 || value.kind === 81 || value.kind === 82 || value.kind === 62 || value.kind === 63 || value.kind === 64 || value.kind === 66 || value.kind === 68 || value.kind === 56 || value.kind === 57 || value.kind === 58 || value.kind === 59 || value.kind === 0 || value.kind === 7 || value.kind === 8 || value.kind === 13 || value.kind === 14 || value.kind === 15 || value.kind === 16 || value.kind === 17 || value.kind === 18 || value.kind === 19 || value.kind === 20 || value.kind === 21 || value.kind === 22 || value.kind === 23 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 || value.kind === 29 || value.kind === 30 || value.kind === 31 || value.kind === 32 || value.kind === 33 || value.kind === 34 || value.kind === 35 || value.kind === 36 || value.kind === 37 || value.kind === 38 || value.kind === 39 || value.kind === 40 || value.kind === 41 || value.kind === 42 || value.kind === 43 || value.kind === 44 || value.kind === 45 || value.kind === 46 || value.kind === 47 || value.kind === 48 || value.kind === 50 || value.kind === 51 || value.kind === 52 || value.kind === 10 || value.kind === 12 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 +} +export function isBoltToken(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 0 || value.kind === 7 || value.kind === 8 || value.kind === 13 || value.kind === 14 || value.kind === 15 || value.kind === 16 || value.kind === 17 || value.kind === 18 || value.kind === 19 || value.kind === 20 || value.kind === 21 || value.kind === 22 || value.kind === 23 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 || value.kind === 29 || value.kind === 30 || value.kind === 31 || value.kind === 32 || value.kind === 33 || value.kind === 34 || value.kind === 35 || value.kind === 36 || value.kind === 37 || value.kind === 38 || value.kind === 39 || value.kind === 40 || value.kind === 41 || value.kind === 42 || value.kind === 43 || value.kind === 44 || value.kind === 45 || value.kind === 46 || value.kind === 47 || value.kind === 48 || value.kind === 50 || value.kind === 51 || value.kind === 52 || value.kind === 10 || value.kind === 12 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 +} +export function isBoltStringLiteral(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 7; +} +export function isBoltIntegerLiteral(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 8; +} +export function isBoltSymbol(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 10 || value.kind === 12 || value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 +} +export function isBoltIdentifier(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 10; +} +export function isBoltOperatorLike(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 24 || value.kind === 25 || value.kind === 26 || value.kind === 27 +} +export function isBoltOperator(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 12; +} +export function isBoltAssignment(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 13; +} +export function isBoltComma(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 14; +} +export function isBoltSemi(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 15; +} +export function isBoltColon(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 16; +} +export function isBoltColonColon(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 17; +} +export function isBoltDot(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 18; +} +export function isBoltDotDot(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 19; +} +export function isBoltRArrow(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 20; +} +export function isBoltRArrowAlt(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 21; +} +export function isBoltLArrow(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 22; +} +export function isBoltEqSign(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 23; +} +export function isBoltGtSign(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 24; +} +export function isBoltExMark(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 25; +} +export function isBoltLtSign(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 26; +} +export function isBoltVBar(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 27; +} +export function isBoltKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 29 || value.kind === 30 || value.kind === 31 || value.kind === 32 || value.kind === 33 || value.kind === 34 || value.kind === 35 || value.kind === 36 || value.kind === 37 || value.kind === 38 || value.kind === 39 || value.kind === 40 || value.kind === 41 || value.kind === 42 || value.kind === 43 || value.kind === 44 || value.kind === 45 || value.kind === 46 || value.kind === 47 || value.kind === 48 +} +export function isBoltWhereKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 29; +} +export function isBoltQuoteKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 30; +} +export function isBoltFnKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 31; +} +export function isBoltForeignKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 32; +} +export function isBoltForKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 33; +} +export function isBoltLetKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 34; +} +export function isBoltReturnKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 35; +} +export function isBoltLoopKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 36; +} +export function isBoltYieldKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 37; +} +export function isBoltMatchKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 38; +} +export function isBoltImportKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 39; +} +export function isBoltExportKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 40; +} +export function isBoltPubKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 41; +} +export function isBoltModKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 42; +} +export function isBoltMutKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 43; +} +export function isBoltEnumKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 44; +} +export function isBoltStructKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 45; +} +export function isBoltTypeKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 46; +} +export function isBoltTraitKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 47; +} +export function isBoltImplKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 48; +} +export function isBoltPunctuated(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 50 || value.kind === 51 || value.kind === 52 +} +export function isBoltParenthesized(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 50; +} +export function isBoltBraced(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 51; +} +export function isBoltBracketed(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 52; +} +export function isBoltSourceFile(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 53; +} +export function isBoltQualName(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 54; +} +export function isBoltTypeExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 56 || value.kind === 57 || value.kind === 58 || value.kind === 59 +} +export function isBoltTypeOfExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 56; +} +export function isBoltReferenceTypeExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 57; +} +export function isBoltFunctionTypeExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 58; +} +export function isBoltLiftedTypeExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 59; +} +export function isBoltTypeParameter(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 60; +} +export function isBoltPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 62 || value.kind === 63 || value.kind === 64 || value.kind === 66 || value.kind === 68 +} +export function isBoltBindPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 62; +} +export function isBoltTypePattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 63; +} +export function isBoltExpressionPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 64; +} +export function isBoltTuplePatternElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 65; +} +export function isBoltTuplePattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 66; +} +export function isBoltRecordFieldPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 67; +} +export function isBoltRecordPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 68; +} +export function isBoltExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 70 || value.kind === 71 || value.kind === 72 || value.kind === 73 || value.kind === 74 || value.kind === 75 || value.kind === 76 || value.kind === 78 || value.kind === 80 || value.kind === 81 || value.kind === 82 +} +export function isBoltQuoteExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 70; +} +export function isBoltTupleExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 71; +} +export function isBoltReferenceExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 72; +} +export function isBoltMemberExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 73; +} +export function isBoltFunctionExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 74; +} +export function isBoltCallExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 75; +} +export function isBoltYieldExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 76; +} +export function isBoltMatchArm(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 77; +} +export function isBoltMatchExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 78; +} +export function isBoltCase(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 79; +} +export function isBoltCaseExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 80; +} +export function isBoltBlockExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 81; +} +export function isBoltConstantExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 82; +} +export function isBoltStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 84 || value.kind === 86 || value.kind === 87 || value.kind === 88 +} +export function isBoltReturnStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 84; +} +export function isBoltConditionalCase(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 85; +} +export function isBoltConditionalStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 86; +} +export function isBoltResumeStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 87; +} +export function isBoltExpressionStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 88; +} +export function isBoltParameter(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 89; +} +export function isBoltDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 96 || value.kind === 97 || value.kind === 110 +} +export function isBoltTypeDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 105 || value.kind === 106 || value.kind === 107 || value.kind === 110 +} +export function isBoltModule(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 93; +} +export function isBoltDeclarationLike(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 96 || value.kind === 97 || value.kind === 105 || value.kind === 106 || value.kind === 107 || value.kind === 110 +} +export function isBoltFunctionBodyElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 96 || value.kind === 97 || value.kind === 112 || value.kind === 84 || value.kind === 86 || value.kind === 87 || value.kind === 88 +} +export function isBoltFunctionDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 96; +} +export function isBoltVariableDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 97; +} +export function isBoltImportSymbol(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 99 +} +export function isBoltPlainImportSymbol(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 99; +} +export function isBoltImportDirective(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 100; +} +export function isBoltExportSymbol(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 101; +} +export function isBoltPlainExportSymbol(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 102; +} +export function isBoltExportDirective(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 103; +} +export function isBoltTraitOrImplElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 96 || value.kind === 107 || value.kind === 112 +} +export function isBoltTraitDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 105; +} +export function isBoltImplDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 106; +} +export function isBoltTypeAliasDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 107; +} +export function isBoltRecordMember(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 109 || value.kind === 112 +} +export function isBoltRecordField(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 109; +} +export function isBoltRecordDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 110; +} +export function isBoltSourceElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 93 || value.kind === 100 || value.kind === 103 || value.kind === 112 || value.kind === 105 || value.kind === 106 || value.kind === 107 || value.kind === 110 || value.kind === 96 || value.kind === 97 || value.kind === 110 || value.kind === 84 || value.kind === 86 || value.kind === 87 || value.kind === 88 +} +export function isBoltMacroCall(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 112; +} +export function isJSSyntax(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 170 || value.kind === 171 || value.kind === 173 || value.kind === 176 || value.kind === 186 || value.kind === 180 || value.kind === 181 || value.kind === 182 || value.kind === 183 || value.kind === 184 || value.kind === 185 || value.kind === 172 || value.kind === 174 || value.kind === 175 || value.kind === 157 || value.kind === 158 || value.kind === 159 || value.kind === 160 || value.kind === 161 || value.kind === 162 || value.kind === 163 || value.kind === 164 || value.kind === 165 || value.kind === 166 || value.kind === 155 || value.kind === 0 || value.kind === 115 || value.kind === 116 || value.kind === 117 || value.kind === 118 || value.kind === 119 || value.kind === 120 || value.kind === 121 || value.kind === 122 || value.kind === 123 || value.kind === 124 || value.kind === 125 || value.kind === 126 || value.kind === 127 || value.kind === 128 || value.kind === 129 || value.kind === 130 || value.kind === 132 || value.kind === 133 || value.kind === 134 || value.kind === 135 || value.kind === 136 || value.kind === 137 || value.kind === 138 || value.kind === 139 || value.kind === 140 || value.kind === 141 || value.kind === 142 || value.kind === 143 || value.kind === 144 || value.kind === 145 || value.kind === 146 || value.kind === 147 || value.kind === 148 || value.kind === 149 || value.kind === 150 || value.kind === 151 || value.kind === 152 || value.kind === 153 +} +export function isJSToken(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 0 || value.kind === 115 || value.kind === 116 || value.kind === 117 || value.kind === 118 || value.kind === 119 || value.kind === 120 || value.kind === 121 || value.kind === 122 || value.kind === 123 || value.kind === 124 || value.kind === 125 || value.kind === 126 || value.kind === 127 || value.kind === 128 || value.kind === 129 || value.kind === 130 || value.kind === 132 || value.kind === 133 || value.kind === 134 || value.kind === 135 || value.kind === 136 || value.kind === 137 || value.kind === 138 || value.kind === 139 || value.kind === 140 || value.kind === 141 || value.kind === 142 || value.kind === 143 || value.kind === 144 || value.kind === 145 || value.kind === 146 || value.kind === 147 || value.kind === 148 || value.kind === 149 || value.kind === 150 || value.kind === 151 || value.kind === 152 || value.kind === 153 +} +export function isJSIdentifier(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 115; +} +export function isJSString(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 116; +} +export function isJSInteger(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 117; +} +export function isJSFromKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 118; +} +export function isJSReturnKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 119; +} +export function isJSTryKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 120; +} +export function isJSFinallyKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 121; +} +export function isJSCatchKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 122; +} +export function isJSImportKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 123; +} +export function isJSAsKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 124; +} +export function isJSConstKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 125; +} +export function isJSLetKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 126; +} +export function isJSExportKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 127; +} +export function isJSFunctionKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 128; +} +export function isJSWhileKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 129; +} +export function isJSForKeyword(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 130; +} +export function isJSOperatorLike(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 143 || value.kind === 144 || value.kind === 145 || value.kind === 146 || value.kind === 147 || value.kind === 148 || value.kind === 149 || value.kind === 150 || value.kind === 151 || value.kind === 152 || value.kind === 153 +} +export function isJSOperator(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 132; +} +export function isJSCloseBrace(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 133; +} +export function isJSCloseBracket(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 134; +} +export function isJSCloseParen(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 135; +} +export function isJSOpenBrace(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 136; +} +export function isJSOpenBracket(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 137; +} +export function isJSOpenParen(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 138; +} +export function isJSSemi(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 139; +} +export function isJSComma(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 140; +} +export function isJSDot(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 141; +} +export function isJSDotDotDot(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 142; +} +export function isJSMulOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 143; +} +export function isJSAddOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 144; +} +export function isJSDivOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 145; +} +export function isJSSubOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 146; +} +export function isJSLtOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 147; +} +export function isJSGtOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 148; +} +export function isJSBOrOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 149; +} +export function isJSBXorOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 150; +} +export function isJSBAndOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 151; +} +export function isJSBNotOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 152; +} +export function isJSNotOp(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 153; +} +export function isJSPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 155 +} +export function isJSBindPattern(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 155; +} +export function isJSExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 157 || value.kind === 158 || value.kind === 159 || value.kind === 160 || value.kind === 161 || value.kind === 162 || value.kind === 163 || value.kind === 164 || value.kind === 165 || value.kind === 166 +} +export function isJSConstantExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 157; +} +export function isJSMemberExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 158; +} +export function isJSCallExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 159; +} +export function isJSBinaryExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 160; +} +export function isJSUnaryExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 161; +} +export function isJSNewExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 162; +} +export function isJSSequenceExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 163; +} +export function isJSConditionalExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 164; +} +export function isJSLiteralExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 165; +} +export function isJSReferenceExpression(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 166; +} +export function isJSSourceElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 182 || value.kind === 183 || value.kind === 184 || value.kind === 185 || value.kind === 172 || value.kind === 174 || value.kind === 175 +} +export function isJSFunctionBodyElement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 183 || value.kind === 184 || value.kind === 185 || value.kind === 172 || value.kind === 174 || value.kind === 175 +} +export function isJSStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 172 || value.kind === 174 || value.kind === 175 +} +export function isJSCatchBlock(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 170; +} +export function isJSTryCatchStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 171; +} +export function isJSExpressionStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 172; +} +export function isJSConditionalCase(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 173; +} +export function isJSConditionalStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 174; +} +export function isJSReturnStatement(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 175; +} +export function isJSParameter(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 176; +} +export function isJSDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 182 || value.kind === 183 || value.kind === 184 || value.kind === 185 +} +export function isJSImportBinding(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 180 || value.kind === 181 +} +export function isJSImportStarBinding(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 180; +} +export function isJSImportAsBinding(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 181; +} +export function isJSImportDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 182; +} +export function isJSFunctionDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 183; +} +export function isJSArrowFunctionDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 184; +} +export function isJSLetDeclaration(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 185; +} +export function isJSSourceFile(value) { + if (!isSyntax(value)) { + return false; + } + return value.kind === 186; +}