UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

30 lines 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RSymbol = void 0; const model_1 = require("../model"); const type_1 = require("../type"); const convert_values_1 = require("../../../convert-values"); /** * Helper for working with {@link RSymbol} AST nodes. */ exports.RSymbol = { ...model_1.RNode, name: 'RSymbol', /** * Type guard for {@link RSymbol} nodes. * @see {@link RSymbol.isSpecial} - to check whether a symbol is a special symbol like `NA` or `NULL` */ is(node) { return node?.type === type_1.RType.Symbol; }, /** * Type guard for special symbols, i.e. `NA` and `NULL`. * @see {@link RNa} - for the value of `NA` * @see {@link RNull} - for the value of `NULL` * @see {@link RSymbol.is} - to check whether a node is a symbol at all */ isSpecial(node) { return exports.RSymbol.is(node) && (node.content === convert_values_1.RNull || node.content === convert_values_1.RNa); } }; //# sourceMappingURL=r-symbol.js.map