UNPKG

@bitloops/bl-transpiler

Version:
26 lines 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IntermediateASTIdentifierNode = void 0; const types_js_1 = require("../../types.js"); const IntermediateASTNode_js_1 = require("./IntermediateASTNode.js"); class IntermediateASTIdentifierNode extends IntermediateASTNode_js_1.IntermediateASTNode { constructor(nodeType, classNodeName, metadata) { super(nodeType, metadata, classNodeName); } getIdentifierName() { const identifierClassNodeName = this.getClassNodeName(); const identifierValue = this.getValue(); const identifierName = identifierValue[identifierClassNodeName]; return identifierName; } //TODO is this needed? typeCheck(symbolTable) { const identifierName = this.getIdentifierName(); const identifierType = symbolTable.lookup(identifierName); if (!identifierType) { throw new types_js_1.MissingIdentifierError(identifierName, this.getMetadata()); } } } exports.IntermediateASTIdentifierNode = IntermediateASTIdentifierNode; //# sourceMappingURL=IntermediateASTIdentifierNode.js.map