@abaplint/core
Version:
abaplint - Core API
16 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CDSAnnotation = void 0;
const _1 = require(".");
const combi_1 = require("../../abap/2_statements/combi");
const cds_annotation_array_1 = require("./cds_annotation_array");
class CDSAnnotation extends combi_1.Expression {
getRunnable() {
const nameWithSlash = (0, combi_1.seq)((0, combi_1.regex)(/^\w+$/), (0, combi_1.star)((0, combi_1.seq)("/", (0, combi_1.regex)(/^\w+$/))));
// Support both "@Name" (single token), "@ Name" (two tokens), and "@< Name" (inline backward annotation)
const annotationStart = (0, combi_1.alt)((0, combi_1.regex)(/^@\w+$/), (0, combi_1.seq)("@", (0, combi_1.regex)(/^\w+$/)), (0, combi_1.seq)("@", "<", (0, combi_1.regex)(/^\w+$/)));
return (0, combi_1.seq)(annotationStart, (0, combi_1.star)((0, combi_1.seq)(".", nameWithSlash)), (0, combi_1.opt)((0, combi_1.seq)(":", (0, combi_1.alt)(cds_annotation_array_1.CDSAnnotationArray, _1.CDSAnnotationObject, _1.CDSAnnotationSimple))));
}
}
exports.CDSAnnotation = CDSAnnotation;
//# sourceMappingURL=cds_annotation.js.map