@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
31 lines • 822 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RLogical = void 0;
const model_1 = require("../model");
const type_1 = require("../type");
/**
* Helper for working with {@link RLogical} AST nodes.
*/
exports.RLogical = {
...model_1.RNode,
name: 'RLogical',
/**
* Type guard for {@link RLogical} nodes.
*/
is(node) {
return node?.type === type_1.RType.Logical;
},
/**
* Checks whether a node is a logical constant with value `TRUE`.
*/
isTrue(node) {
return exports.RLogical.is(node) && node.content;
},
/**
* Checks whether a node is a logical constant with value `FALSE`.
*/
isFalse(node) {
return exports.RLogical.is(node) && !node.content;
}
};
//# sourceMappingURL=r-logical.js.map