UNPKG

@kipper/target-js

Version:

The JavaScript target for the Kipper compiler 🦊

64 lines • 3.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JavaScriptTargetSemanticAnalyser = void 0; const tslib_1 = require("tslib"); const core_1 = require("@kipper/core"); const target_1 = require("./target"); class JavaScriptTargetSemanticAnalyser extends core_1.KipperTargetSemanticAnalyser { constructor() { super(...arguments); this.compoundStatement = undefined; this.ifStatement = undefined; this.switchStatement = undefined; this.expressionStatement = undefined; this.doWhileLoopStatement = undefined; this.whileLoopStatement = undefined; this.forLoopStatement = undefined; this.jumpStatement = undefined; this.returnStatement = undefined; this.parameterDeclaration = (node) => tslib_1.__awaiter(this, void 0, void 0, function* () { this.checkViabilityOfIdentifier(node); }); this.functionDeclaration = (node) => tslib_1.__awaiter(this, void 0, void 0, function* () { this.checkViabilityOfIdentifier(node); }); this.variableDeclaration = (node) => tslib_1.__awaiter(this, void 0, void 0, function* () { this.checkViabilityOfIdentifier(node); }); this.numberPrimaryExpression = undefined; this.listPrimaryExpression = undefined; this.identifierPrimaryExpression = undefined; this.memberAccessExpression = undefined; this.identifierTypeSpecifierExpression = undefined; this.genericTypeSpecifierExpression = undefined; this.typeofTypeSpecifierExpression = undefined; this.stringPrimaryExpression = undefined; this.fStringPrimaryExpression = undefined; this.boolPrimaryExpression = undefined; this.tangledPrimaryExpression = undefined; this.voidOrNullOrUndefinedPrimaryExpression = undefined; this.incrementOrDecrementPostfixExpression = undefined; this.functionCallExpression = undefined; this.incrementOrDecrementUnaryExpression = undefined; this.operatorModifiedUnaryExpression = undefined; this.castOrConvertExpression = undefined; this.multiplicativeExpression = undefined; this.additiveExpression = undefined; this.relationalExpression = undefined; this.equalityExpression = undefined; this.logicalAndExpression = undefined; this.logicalOrExpression = undefined; this.conditionalExpression = undefined; this.assignmentExpression = undefined; } checkViabilityOfIdentifier(declaration) { const identifier = declaration.getSemanticData().identifier; if (identifier === target_1.TargetJS.internalObjectIdentifier || target_1.TargetJS.reservedIdentifiers.find((i) => i === identifier)) { this.setTracebackData({ ctx: declaration }); throw this.error(new core_1.ReservedIdentifierOverwriteError(identifier)); } } } exports.JavaScriptTargetSemanticAnalyser = JavaScriptTargetSemanticAnalyser; //# sourceMappingURL=semantic-analyser.js.map