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 | 1x 1x 1x 1x 1x 1x 1x 1x 1886x 1886x 1886x 1886x 1886x 1886x 113x 113x 113x 113x 113x 113x 1773x 1773x 1773x 1773x 1886x 4x 4x 4x 4x 4x 1773x 1773x 1x | import {ExpressionNode} from "../../nodes";
import {VoidType} from "../../types/basic";
import {AbstractType} from "../../types/basic/_abstract_type";
import {ReferenceType} from "../_reference";
import {CheckSyntaxKey, SyntaxInput, syntaxIssue} from "../_syntax_input";
export class SourceField {
public static runSyntax(node: ExpressionNode, input: SyntaxInput, type?: ReferenceType | ReferenceType[],
error = true): AbstractType | undefined {
const token = node.getFirstToken();
const name = token.getStr();
const found = input.scope.findVariable(name);
if (found === undefined) {
const message = "\"" + name + "\" not found, findTop";
if (error === true) {
input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
}
return VoidType.get(CheckSyntaxKey);
}
if (type) {
input.scope.addReference(token, found, type, input.filename);
}
if (name.includes("~")) {
const idef = input.scope.findInterfaceDefinition(name.split("~")[0]);
if (idef) {
input.scope.addReference(token, idef, ReferenceType.ObjectOrientedReference, input.filename);
}
}
return found.getType();
}
} |