simc-ast-builder
Version:
Parser and AST generator for SimulationCraft files
25 lines • 927 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleAnyTokenExpr = void 0;
const SimCVisitorError_1 = require("../../errors/SimCVisitorError");
const ContextHandlerRegistry_1 = require("../ContextHandlerRegistry");
/**
* Handler for any token expression contexts (catch-all)
*/
const handleAnyTokenExpr = (ctx, visitor) => {
if (!ctx.text) {
throw new SimCVisitorError_1.SimCVisitorError("Empty token text", ctx);
}
// Only add warning if this token isn't handled by a registered handler
if (!ContextHandlerRegistry_1.contextHandlerRegistry.hasAccessHandler(ctx.text)) {
// addWarning("anyTokenExpr", ctx.text);
}
return {
expressionType: "neutral",
kind: "expression",
nodeType: "literal",
value: ctx.text,
};
};
exports.handleAnyTokenExpr = handleAnyTokenExpr;
//# sourceMappingURL=AnyTokenExprHandler.js.map