UNPKG

simc-ast-builder

Version:

Parser and AST generator for SimulationCraft files

27 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleRaidEvent = void 0; const SimCVisitorError_1 = require("../../errors/SimCVisitorError"); const fieldMaps_1 = require("../../utils/fieldMaps"); /** * Handler for raid_event access contexts */ const handleRaidEvent = ({ ctx, parts, }) => { if (parts.length < 2) { throw new SimCVisitorError_1.SimCVisitorError("Raid event access requires an event name", ctx); } const eventName = parts[1]; // Non-null assertion since we check parts.length above const rawField = parts.length > 2 ? parts[2] : null; const defaultField = (0, fieldMaps_1.getDefaultField)("raid_event"); const field = rawField || defaultField || ""; const fieldDef = (0, fieldMaps_1.getFieldDef)(field); return { eventName, expressionType: fieldDef.type, field: fieldDef, kind: "expression", nodeType: "raid_event", }; }; exports.handleRaidEvent = handleRaidEvent; //# sourceMappingURL=RaidEventHandler.js.map