UNPKG

@abaplint/core

Version:
32 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SourceField = void 0; const basic_1 = require("../../types/basic"); const _reference_1 = require("../_reference"); const _syntax_input_1 = require("../_syntax_input"); class SourceField { static runSyntax(node, input, type, error = true) { 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((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message)); } return basic_1.VoidType.get(_syntax_input_1.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, _reference_1.ReferenceType.ObjectOrientedReference, input.filename); } } return found.getType(); } } exports.SourceField = SourceField; //# sourceMappingURL=source_field.js.map