@abaplint/core
Version:
abaplint - Core API
26 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InlineFS = void 0;
const Expressions = require("../../2_statements/expressions");
const _typed_identifier_1 = require("../../types/_typed_identifier");
const basic_1 = require("../../types/basic");
const _reference_1 = require("../_reference");
class InlineFS {
static runSyntax(node, input, type) {
var _a;
const token = (_a = node.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
if (token && type) {
const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
input.scope.addIdentifier(identifier);
input.scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
}
else if (token) {
const message = "InlineFS, could not determine type for \"" + token.getStr() + "\"";
const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, new basic_1.UnknownType(message), ["inline" /* IdentifierMeta.InlineDefinition */]);
input.scope.addIdentifier(identifier);
input.scope.addReference(token, identifier, _reference_1.ReferenceType.DataWriteReference, input.filename);
}
}
}
exports.InlineFS = InlineFS;
//# sourceMappingURL=inline_fs.js.map