@abaplint/core
Version:
abaplint - Core API
40 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableExpression = void 0;
const nodes_1 = require("../../nodes");
const Expressions = require("../../2_statements/expressions");
const source_1 = require("./source");
const basic_1 = require("../../types/basic");
const component_chain_1 = require("./component_chain");
class TableExpression {
static runSyntax(node, input, rowType) {
if (node === undefined) {
return;
}
let context = rowType;
if (context instanceof basic_1.TableType) {
context = context.getRowType();
}
if (node.getChildren().length === 3) {
const s = node.findDirectExpression(Expressions.Source);
source_1.Source.runSyntax(s, input, context);
}
else if (node.findDirectTokenByText("INDEX")) {
const s = node.findDirectExpression(Expressions.Source);
source_1.Source.runSyntax(s, input);
}
else {
let fieldType = undefined;
for (const c of node.getChildren()) {
if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.ComponentChainSimple) {
fieldType = component_chain_1.ComponentChain.runSyntax(context, c, input);
}
else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.Source) {
source_1.Source.runSyntax(c, input, fieldType);
}
}
}
}
}
exports.TableExpression = TableExpression;
//# sourceMappingURL=table_expression.js.map