@abaplint/core
Version:
abaplint - Core API
30 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabaseTable = void 0;
const _reference_1 = require("../_reference");
const _syntax_input_1 = require("../_syntax_input");
class DatabaseTable {
static runSyntax(node, input) {
const token = node.getFirstToken();
const name = token.getStr();
if (name === "(") {
// dynamic
return undefined;
}
const found = input.scope.getDDIC().lookupTableOrView2(name);
if (found === undefined && input.scope.getDDIC().inErrorNamespace(name) === true) {
const message = "Database table or view \"" + name + "\" not found";
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
}
else if (found === undefined) {
input.scope.addReference(token, undefined, _reference_1.ReferenceType.TableVoidReference, input.filename);
}
else {
input.scope.addReference(token, found.getIdentifier(), _reference_1.ReferenceType.TableReference, input.filename);
input.scope.getDDICReferences().addUsing(input.scope.getParentObj(), { object: found, token: token, filename: input.filename });
}
return found;
}
}
exports.DatabaseTable = DatabaseTable;
//# sourceMappingURL=database_table.js.map