UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

27 lines 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeComment = normalizeComment; const normalize_meta_1 = require("../../normalize-meta"); const assert_1 = require("../../../../../../../util/assert"); const type_1 = require("../../../../model/type"); /** * Normalize the given object as an R comment. * This requires you to check the corresponding name beforehand. * @param data - The data used by the parser (see {@link NormalizerData}) * @param obj - The JSON object to extract the meta-information from */ function normalizeComment(data, obj) { const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(obj); (0, assert_1.guard)(content.startsWith('#'), 'comment must start with #'); return { type: type_1.RType.Comment, location, lexeme: content, info: { fullRange: data.currentRange, adToks: [], fullLexeme: content } }; } //# sourceMappingURL=normalize-comment.js.map