// Code generated by _scripts/generate-encoder.ts. DO NOT EDIT.
import { SyntaxKind } from "../../ast/index.js";
import { NODE_DATA_TYPE_CHILDREN, NODE_DATA_TYPE_EXTENDED, NODE_DATA_TYPE_STRING, } from "./protocol.js";
export function getNodeDataType(kind) {
    switch (kind) {
        case SyntaxKind.Identifier:
        case SyntaxKind.PrivateIdentifier:
        case SyntaxKind.JsxText:
        case SyntaxKind.JSDocText:
        case SyntaxKind.JSDocLink:
        case SyntaxKind.JSDocLinkPlain:
        case SyntaxKind.JSDocLinkCode:
            return NODE_DATA_TYPE_STRING;
        case SyntaxKind.StringLiteral:
        case SyntaxKind.NumericLiteral:
        case SyntaxKind.BigIntLiteral:
        case SyntaxKind.RegularExpressionLiteral:
        case SyntaxKind.NoSubstitutionTemplateLiteral:
        case SyntaxKind.TemplateHead:
        case SyntaxKind.TemplateMiddle:
        case SyntaxKind.TemplateTail:
        case SyntaxKind.SourceFile:
            return NODE_DATA_TYPE_EXTENDED;
        default:
            return NODE_DATA_TYPE_CHILDREN;
    }
}
export function getNodeCommonData(node) {
    switch (node.kind) {
        case SyntaxKind.Block:
            return (node.multiLine ? 1 : 0) << 24;
        case SyntaxKind.HeritageClause:
            return (node.token === SyntaxKind.ImplementsKeyword ? 1 : 0) << 24;
        case SyntaxKind.ExportAssignment:
            return (node.isExportEquals ? 1 : 0) << 24;
        case SyntaxKind.ExportSpecifier:
            return (node.isTypeOnly ? 1 : 0) << 24;
        case SyntaxKind.PrefixUnaryExpression:
            return (node.operator === SyntaxKind.MinusToken ? 1 : node.operator === SyntaxKind.TildeToken ? 2 : node.operator === SyntaxKind.ExclamationToken ? 3 : node.operator === SyntaxKind.PlusPlusToken ? 4 : node.operator === SyntaxKind.MinusMinusToken ? 5 : 0) << 24;
        case SyntaxKind.PostfixUnaryExpression:
            return (node.operator === SyntaxKind.MinusMinusToken ? 1 : 0) << 24;
        case SyntaxKind.MetaProperty:
            return (node.keywordToken === SyntaxKind.NewKeyword ? 1 : 0) << 24;
        case SyntaxKind.ArrayLiteralExpression:
            return (node.multiLine ? 1 : 0) << 24;
        case SyntaxKind.ObjectLiteralExpression:
            return (node.multiLine ? 1 : 0) << 24;
        case SyntaxKind.TypeOperator:
            return (node.operator === SyntaxKind.ReadonlyKeyword ? 1 : node.operator === SyntaxKind.UniqueKeyword ? 2 : 0) << 24;
        case SyntaxKind.ImportAttributes:
            return (node.multiLine ? 1 : 0) << 24 | (node.token === SyntaxKind.AssertKeyword ? 1 : 0) << 25;
        case SyntaxKind.JsxText:
            return (node.containsOnlyTriviaWhiteSpaces ? 1 : 0) << 24;
        case SyntaxKind.ModuleDeclaration:
            return (node.keyword === SyntaxKind.NamespaceKeyword ? 1 : 0) << 24;
        case SyntaxKind.ImportEqualsDeclaration:
            return (node.isTypeOnly ? 1 : 0) << 24;
        case SyntaxKind.ExportDeclaration:
            return (node.isTypeOnly ? 1 : 0) << 24;
        case SyntaxKind.ImportType:
            return (node.isTypeOf ? 1 : 0) << 24;
        case SyntaxKind.ImportClause:
            return (node.phaseModifier === SyntaxKind.TypeKeyword ? 1 : node.phaseModifier === SyntaxKind.DeferKeyword ? 2 : 0) << 24;
        case SyntaxKind.ImportSpecifier:
            return (node.isTypeOnly ? 1 : 0) << 24;
        case SyntaxKind.JSDocTypeLiteral:
            return (node.isArrayType ? 1 : 0) << 24;
        case SyntaxKind.JSDocParameterTag:
        case SyntaxKind.JSDocPropertyTag:
            return (node.isBracketed ? 1 : 0) << 24 | (node.isNameFirst ? 1 : 0) << 25;
    }
    return 0;
}
//# sourceMappingURL=encoder.generated.js.map