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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 237x 237x 237x 210x 210x 210x 210x 27x 27x 237x 27x 27x 27x 237x 13x 13x 13x 237x 237x 1x | import {ExpressionNode, StatementNode} from "../../nodes";
import {MethodCallChain} from "../expressions/method_call_chain";
import {MethodSource} from "../expressions/method_source";
import {MethodCallBody} from "../expressions/method_call_body";
import {VoidType} from "../../types/basic/void_type";
import {StatementSyntax} from "../_statement_syntax";
import {SyntaxInput, syntaxIssue} from "../_syntax_input";
export class Call implements StatementSyntax {
public runSyntax(node: StatementNode, input: SyntaxInput): void {
const children = node.getChildren();
if (children.length === 2) {
const first = children[0] as ExpressionNode;
MethodCallChain.runSyntax(first, input);
return;
}
const methodSource = children[2] as ExpressionNode;
if (methodSource === undefined) {
const message = "Call, child MethodSource not found";
input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
return;
}
const methodDef = MethodSource.runSyntax(methodSource, input);
const body = children[3];
if (body instanceof ExpressionNode) {
// todo, resolve the method definition above and pass, if possible, in case of dynamic pass void
MethodCallBody.runSyntax(body, input, methodDef || VoidType.get("CallTODO"));
}
}
} |