@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
40 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueStringBot = exports.ValueStringTop = exports.ValueEmptyString = void 0;
exports.stringFrom = stringFrom;
exports.liftString = liftString;
exports.collectStrings = collectStrings;
const general_1 = require("../general");
const r_value_1 = require("../r-value");
function stringFrom(str) {
return {
type: 'string',
value: typeof str === 'string' ? {
quotes: '"',
str: str
} : str,
};
}
function liftString(str) {
return {
type: 'string',
value: str
};
}
function collectStrings(a) {
if ((0, general_1.bottomTopGuard)(a)) {
return undefined;
}
const values = [];
for (const value of a) {
if (value.type !== 'string' || !(0, r_value_1.isValue)(value) || !(0, r_value_1.isValue)(value.value)) {
return undefined;
}
values.push(value.value.str);
}
return values;
}
exports.ValueEmptyString = stringFrom('');
exports.ValueStringTop = liftString(r_value_1.Top);
exports.ValueStringBot = liftString(r_value_1.Bottom);
//# sourceMappingURL=string-constants.js.map