Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 52x 52x 52x 52x 36x 36x 52x 52x 19x 19x 52x 33x 33x 33x 185x 39x 185x 39x 39x 185x 33x 52x 1x | import {ExpressionNode} from "../../nodes";
import * as Expressions from "../../2_statements/expressions";
import {Source} from "./source";
import {SyntaxInput} from "../_syntax_input";
import {AbstractType} from "../../..";
import {TableType} from "../../types/basic";
import {ComponentChain} from "./component_chain";
export class TableExpression {
public static runSyntax(node: ExpressionNode | undefined, input: SyntaxInput, rowType: AbstractType | undefined) {
if (node === undefined) {
return;
}
let context = rowType;
if (context instanceof TableType) {
context = context.getRowType();
}
if (node.getChildren().length === 3) {
const s = node.findDirectExpression(Expressions.Source);
Source.runSyntax(s, input, context);
} else if (node.findDirectTokenByText("INDEX")) {
const s = node.findDirectExpression(Expressions.Source);
Source.runSyntax(s, input);
} else {
let fieldType: AbstractType | undefined = undefined;
for (const c of node.getChildren()) {
if (c instanceof ExpressionNode && c.get() instanceof Expressions.ComponentChainSimple) {
fieldType = ComponentChain.runSyntax(context, c, input);
} else if (c instanceof ExpressionNode && c.get() instanceof Expressions.Source) {
Source.runSyntax(c, input, fieldType);
}
}
}
}
} |