simc-ast-builder
Version:
Parser and AST generator for SimulationCraft files
24 lines • 821 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handlePriest = void 0;
const SimCVisitorError_1 = require("../../../errors/SimCVisitorError");
const fieldMaps_1 = require("../../../utils/fieldMaps");
/**
* Handler for priest access contexts
* This handles access to priest-specific properties
*/
const handlePriest = ({ ctx, parts, }) => {
if (parts.length < 2) {
throw new SimCVisitorError_1.SimCVisitorError("Priest 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: "priest",
};
};
exports.handlePriest = handlePriest;
//# sourceMappingURL=PriestHandler.js.map