UNPKG

simc-ast-builder

Version:

Parser and AST generator for SimulationCraft files

60 lines 2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleStealthed = exports.handleRtbBuffs = exports.handleRogue = void 0; const SimCVisitorError_1 = require("../../../errors/SimCVisitorError"); const fieldMaps_1 = require("../../../utils/fieldMaps"); /** * Handler for rogue access contexts * This handles access to rogue-specific properties */ const handleRogue = ({ ctx, parts }) => { if (parts.length < 2) { throw new SimCVisitorError_1.SimCVisitorError("Rogue access requires a field", ctx); } const field = parts[1] || ""; const fieldDef = (0, fieldMaps_1.getFieldDef)(field); return { expressionType: fieldDef.type, field: fieldDef, kind: "expression", nodeType: "rogue", }; }; exports.handleRogue = handleRogue; /** * Handler for rtb_buffs access contexts * This handles access to Roll the Bones buffs for Outlaw Rogue */ const handleRtbBuffs = ({ ctx, parts, }) => { if (parts.length < 2) { throw new SimCVisitorError_1.SimCVisitorError("RtbBuffs access requires a field", ctx); } const field = parts[1] || ""; const fieldDef = (0, fieldMaps_1.getFieldDef)(field); return { expressionType: fieldDef.type, field: fieldDef, kind: "expression", nodeType: "rtb_buffs", }; }; exports.handleRtbBuffs = handleRtbBuffs; /** * Handler for stealthed access contexts * This handles access to stealth-specific properties for Rogue */ const handleStealthed = ({ ctx, parts, }) => { if (parts.length < 2) { throw new SimCVisitorError_1.SimCVisitorError("Stealthed access requires a field", ctx); } const field = parts[1] || ""; const fieldDef = (0, fieldMaps_1.getFieldDef)(field); return { expressionType: fieldDef.type, field: fieldDef, kind: "expression", nodeType: "stealthed", }; }; exports.handleStealthed = handleStealthed; //# sourceMappingURL=RogueHandler.js.map