UNPKG

@abaplint/core

Version:
43 lines 2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteInternal = void 0; const Expressions = require("../../2_statements/expressions"); const target_1 = require("../expressions/target"); const source_1 = require("../expressions/source"); const component_compare_1 = require("../expressions/component_compare"); const component_cond_1 = require("../expressions/component_cond"); const basic_1 = require("../../types/basic"); class DeleteInternal { runSyntax(node, input) { var _a; for (const s of node.findDirectExpressions(Expressions.Source)) { source_1.Source.runSyntax(s, input); } let targetType = undefined; const target = node.findDirectExpression(Expressions.Target); if (target) { let tabl = undefined; if (node.getChildren().length === 5 && node.getChildren()[2].concatTokens().toUpperCase() === "FROM") { // it might be a database table tabl = (_a = input.scope.getDDIC()) === null || _a === void 0 ? void 0 : _a.lookupTableOrView(target.concatTokens()); if (tabl) { input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: tabl.object }); } } if (tabl === undefined) { targetType = target_1.Target.runSyntax(target, input); if (targetType instanceof basic_1.TableType) { targetType = targetType.getRowType(); } } } for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) { component_compare_1.ComponentCompare.runSyntax(t, input, targetType); } for (const t of node.findDirectExpressions(Expressions.ComponentCond)) { component_cond_1.ComponentCond.runSyntax(t, input, targetType); } } } exports.DeleteInternal = DeleteInternal; //# sourceMappingURL=delete_internal.js.map