UNPKG

simc-ast-builder

Version:

Parser and AST generator for SimulationCraft files

26 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleMixedIdExpr = void 0; const SimCVisitorError_1 = require("../../errors/SimCVisitorError"); const ContextHandlerRegistry_1 = require("../ContextHandlerRegistry"); /** * Handler for mixed ID expression contexts */ const handleMixedIdExpr = (ctx, visitor) => { if (!ctx.text) { throw new SimCVisitorError_1.SimCVisitorError("Empty mixed ID text", ctx); } // Check if this mixed ID is a registered access handler if (ContextHandlerRegistry_1.contextHandlerRegistry.hasAccessHandler(ctx.text)) { // If it is, use that handler instead return ContextHandlerRegistry_1.contextHandlerRegistry.dispatchAccess(ctx.text, ctx, visitor, [ctx.text]); } return { expressionType: "neutral", kind: "expression", nodeType: "identifier", value: ctx.text, }; }; exports.handleMixedIdExpr = handleMixedIdExpr; //# sourceMappingURL=MixedIdExprHandler.js.map