@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
37 lines • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RExpressionList = void 0;
const model_1 = require("../model");
const type_1 = require("../type");
/**
* Helper for working with {@link RExpressionList} AST nodes.
*/
exports.RExpressionList = {
...model_1.RNode,
name: 'RExpressionList',
/**
* Type guard for {@link RExpressionList} nodes.
*/
is(node) {
return node?.type === type_1.RType.ExpressionList;
},
/**
* Type guard for implicit {@link RExpressionList} nodes, i.e., expression lists that are not created by a wrapper like `{}`.
*/
isImplicit(node) {
return exports.RExpressionList.is(node) && node.grouping === undefined;
},
/**
* Returns the grouping symbol at the start of the expression list, if it exists. For example, for an expression list created by `{ ... }`, this would return the symbol for `{`.
*/
groupStart(node) {
return node.grouping?.[0];
},
/**
* Returns the grouping symbol at the end of the expression list, if it exists. For example, for an expression list created by `{ ... }`, this would return the symbol for `}`.
*/
groupEnd(node) {
return node.grouping?.[1];
}
};
//# sourceMappingURL=r-expression-list.js.map