UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

1,434 lines 143 kB
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultBuiltinConfig = exports.WrittenBuiltinDefinitions = exports.RGroupGenerics = exports.GgPlotAddons = exports.GraphicsPlotAddons = exports.PlotFunctionsWithAddParam = exports.GgPlotImplicitAddons = exports.TinyPlotAddons = exports.PlotCreate = exports.GraphicsPlotCreate = exports.TinyPlotCrate = exports.GgPlotCreate = exports.PlotFunctionPackages = exports.StackEnvBuiltins = exports.StackEnvKind = void 0;
exports.namespacePlotFunctions = namespacePlotFunctions;
exports.statedSignatures = statedSignatures;
exports.statedSignatureOf = statedSignatureOf;
exports.getDefaultProcessor = getDefaultProcessor;
const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
const cascade_action_1 = require("../../queries/catalog/call-context-query/cascade-action");
const unnamed_call_handling_1 = require("../internal/process/functions/call/unnamed-call-handling");
const hooks_1 = require("../hooks");
const identifier_1 = require("./identifier");
const built_in_proc_name_1 = require("./built-in-proc-name");
const built_in_eval_name_1 = require("./built-in-eval-name");
const known_call_handling_1 = require("../internal/process/functions/call/known-call-handling");
const nse_1 = require("../internal/process/functions/call/nse");
const data_masking_functions_1 = require("./data-masking-functions");
const built_in_props_1 = require("./built-in-props");
const r_base_packages_1 = require("../../util/r-base-packages");
const r_base_packages_generated_1 = require("../../data/r-base-packages.generated");
/** Which stack environment an env-returning/-transforming builtin denotes (see {@link StackEnvBuiltins}). */
var StackEnvKind;
(function (StackEnvKind) {
    StackEnvKind[StackEnvKind["Global"] = 0] = "Global";
    StackEnvKind[StackEnvKind["Base"] = 1] = "Base";
    StackEnvKind[StackEnvKind["Empty"] = 2] = "Empty";
    StackEnvKind[StackEnvKind["Current"] = 3] = "Current";
    StackEnvKind[StackEnvKind["Parent"] = 4] = "Parent";
    /** `parent.frame()`: the dynamic caller's frame, over-approximated to the global env (exact at a top-level call). */
    StackEnvKind[StackEnvKind["CallerFrame"] = 5] = "CallerFrame";
    StackEnvKind[StackEnvKind["Named"] = 6] = "Named";
})(StackEnvKind || (exports.StackEnvKind = StackEnvKind = {}));
/** Maps the env-returning/-transforming base builtins and constants to the stack environment each denotes. */
exports.StackEnvBuiltins = {
    globalenv: StackEnvKind.Global,
    baseenv: StackEnvKind.Base,
    emptyenv: StackEnvKind.Empty,
    environment: StackEnvKind.Current,
    'parent.env': StackEnvKind.Parent,
    'parent.frame': StackEnvKind.CallerFrame,
    'as.environment': StackEnvKind.Named,
    /* `.env$x` reaches past the data mask */
    '.env': StackEnvKind.Current,
    '.GlobalEnv': StackEnvKind.Global,
    '.BaseEnv': StackEnvKind.Base,
    '.BaseNamespaceEnv': StackEnvKind.Base
};
/**
 * The package owning each plotting function no base-R package exports; a name listed nowhere stays bare.
 * A built-in without a package answers to any `pkg::name`, which is how `base::ggplot` used to resolve.
 */
exports.PlotFunctionPackages = {
    ggplot2: ['ggplot', 'qplot', 'quickplot', 'autoplot'],
    plotly: ['ggplotly', 'plot_ly'],
    ggExtra: ['ggMarginal'],
    ggcorrplot: ['ggcorrplot'],
    forecast: ['ggseasonplot'],
    ggdendro: ['ggdendrogram'],
    ggmap: ['qmap'],
    gridExtra: ['grid.arrange'],
    factoextra: ['fviz_pca_biplot', 'fviz_pca', 'fviz_pca_ind', 'fviz_pca_var', 'fviz_screeplot',
        'fviz_mca_biplot', 'fviz_mca', 'fviz_mca_ind', 'fviz_mca_var', 'fviz_cluster', 'fviz_dend'],
    survminer: ['ggsurvplot'],
    tinyplot: ['tinyplot', 'plt', 'tinyplot_add', 'plt_add'],
    lattice: ['xyplot', 'bwplot', 'stripplot', 'dotplot', 'histogram', 'splom', 'trellis.device'],
    maps: ['map'],
    leaflet: ['leaflet'],
    tmap: ['tm_shape'],
    pheatmap: ['pheatmap'],
    vioplot: ['vioplot'],
    gplots: ['heatmap.2', 'textplot', 'boxplot2'],
    DHARMa: ['plotSimulatedResiduals'],
    magick: ['image_graph', 'image_draw'],
    ragg: ['agg_png', 'agg_jpeg', 'agg_tiff', 'agg_ppm', 'agg_webp', 'agg_capture'],
    rasterpdf: ['raster_pdf']
};
const PlotFunctionOwner = new Map(Object.entries(exports.PlotFunctionPackages).flatMap(([pkg, names]) => names.map(n => [n, pkg])));
/** `names` under the package exporting each: base R from the shipped data, the rest from {@link PlotFunctionPackages}. */
function namespacePlotFunctions(names) {
    return names.map(n => {
        const pkg = (0, r_base_packages_1.baseRExportOwner)(n) ?? PlotFunctionOwner.get(n);
        return pkg === undefined ? n : identifier_1.Identifier.make(n, pkg);
    });
}
exports.GgPlotCreate = [
    'ggplot', 'ggplotly', 'ggMarginal', 'ggcorrplot', 'ggseasonplot', 'ggdendrogram', 'qmap', 'qplot', 'quickplot', 'autoplot', 'grid.arrange',
    'fviz_pca_biplot', 'fviz_pca', 'fviz_pca_ind', 'fviz_pca_var', 'fviz_screeplot', 'fviz_mca_biplot', 'fviz_mca', 'fviz_mca_ind', 'fviz_mca_var', 'fviz_cluster', 'fviz_dend',
    'ggsurvplot',
];
exports.TinyPlotCrate = [
    'tinyplot', 'plt'
];
exports.GraphicsPlotCreate = [
    'plot', 'plot.new', 'xspline', 'map', 'curve', 'image', 'boxplot', 'dotchart', 'sunflowerplot', 'barplot', 'matplot', 'hist', 'stem',
    'density', 'smoothScatter', 'contour', 'persp', 'XYPlot', 'xyplot', 'stripplot', 'bwplot', 'dotPlot', 'dotplot', 'histPlot', 'densityPlot', 'qPlot', 'qqplot', 'qqPlot', 'boxPlot',
    'bxp', 'assocplot', 'mosaicplot', 'stripchart', 'fourfoldplot', 'plot.xy', 'plot.formula', 'plot.default', 'plot.design', 'stars', 'cotabplot', 'pheatmap',
    'spineplot', 'Plotranges', 'regressogram', 'bootcurve', 'meanplot', 'vioplot', 'pairs', 'copolot', 'histogram', 'splom', 'leaflet', 'tm_shape', 'plot_ly', 'plotProfLik', 'plotSimulatedResiduals', 'plotmeans',
    'overplot', 'residplot', 'heatmap.2', 'lmplot2', 'sinkplot', 'textplot', 'boxplot2', 'profLikCI',
];
exports.PlotCreate = exports.GraphicsPlotCreate.concat(exports.TinyPlotCrate, exports.GgPlotCreate);
const GraphicDeviceOpen = [
    'pdf', 'jpeg', 'png', 'windows', 'postscript', 'xfig', 'bitmap', 'pictex', 'cairo_pdf', 'svg', 'bmp', 'tiff', 'X11', 'quartz', 'image_graph',
    'image_draw', 'dev.new', 'trellis.device', 'raster_pdf',
    'agg_png', 'agg_jpeg', 'agg_tiff', 'agg_ppm', 'agg_webp', 'agg_capture'
];
exports.TinyPlotAddons = [
    'tinyplot_add', 'plt_add'
];
exports.GgPlotImplicitAddons = [
    'geom_count', 'geom_bin_2d', 'geom_spoke', 'geom_tile', 'geom_rect',
    'geom_function', 'geom_crossbar', 'geom_density2d', 'geom_abline', 'geom_errorbar', 'geom_errorbarh',
    'geom_jitter', 'geom_line', 'geom_density', 'geom_quantile', 'geom_qq', 'geom_qq_line', 'geom_segment', 'geom_label', 'geom_density_2d',
    'geom_violin', 'geom_contour', 'geom_boxplot', 'geom_col', 'geom_blank', 'geom_histogram', 'geom_hline', 'geom_area', 'geom_sf_text', 'geom_smooth', 'geom_text',
    'geom_density2d_filled', 'geom_ribbon', 'geom_sf', 'geom_dotplot', 'geom_freqpoly', 'geom_step', 'geom_map', 'geom_bin2d', 'geom_rug', 'geom_raster', 'geom_pointrange', 'geom_point',
    'geom_hex', 'geom_contour_filled', 'geom_bar', 'geom_vline', 'geom_linerange', 'geom_curve', 'geom_path', 'geom_polygon', 'geom_sf_label', 'geom_density_2d_filled', 'geom_dumbbell',
    'geom_encircle', 'stat_count', 'stat_density', 'stat_bin_hex', 'stat_bin_2d', 'stat_summary_bin', 'stat_identity', 'stat_qq', 'stat_binhex', 'stat_boxplot', 'stat_function',
    'stat_align', 'stat_contour_filled', 'stat_summary_2d', 'stat_qq_line', 'stat_contour', 'stat_ydensity', 'stat_summary_hex', 'stat_summary2d', 'stat_sf_coordinates',
    'stat_density_2d_filled', 'stat_smooth', 'stat_density2d', 'stat_ecdf', 'stat_sf', 'stat_quantile', 'stat_unique', 'stat_density_2d', 'stat_ellipse', 'stat_summary',
    'stat_density2d_filled', 'stat_bin', 'stat_sum', 'stat_spoke', 'stat_bin2d',
    'labs', 'theme_void', 'theme_test', 'theme_minimal', 'theme_light', 'theme', 'theme_get', 'theme_gray', 'theme_dark', 'theme_classic', 'theme_linedraw', 'theme_update',
    'theme_replace', 'theme_grey', 'theme_bw', 'theme_tufte', 'theme_survminer', 'facet_null', 'facet_grid', 'facet_wrap', 'xlab', 'xlim', 'ylab', 'ylim',
    'scale_linewidth_ordinal', 'scale_fill_steps', 'scale_color_gradient2', 'scale_size_manual', 'scale_colour_discrete', 'scale_color_identity',
    'scale_fill_fermenter', 'scale_alpha_manual', 'scale_fill_gradient', 'scale_size_date', 'scale_fill_viridis_b', 'scale_x_time', 'scale_linetype_manual',
    'scale_alpha_binned', 'scale_color_grey', 'scale_colour_gradient', 'scale_linewidth_date', 'scale_color_steps2', 'scale_color_viridis_b', 'scale_size_binned',
    'scale_colour_gradientn', 'scale_linewidth_manual', 'scale_fill_viridis_c', 'scale_fill_manual', 'scale_color_viridis_c', 'scale_fill_discrete', 'scale_size_discrete',
    'scale_fill_binned', 'scale_fill_viridis_d', 'scale_colour_fermenter', 'scale_color_viridis_d', 'scale_x_datetime', 'scale_size_identity', 'scale_linewidth_identity',
    'scale_shape_ordinal', 'scale_linewidth_discrete', 'scale_fill_ordinal', 'scale_y_time', 'scale_color_ordinal', 'scale_size_ordinal', 'scale_colour_distiller',
    'scale_linewidth_datetime', 'scale_alpha_identity', 'scale_color_steps', 'scale_alpha_discrete', 'scale_fill_date', 'scale_x_reverse', 'scale_fill_gradientn', 'scale_size_datetime',
    'scale_y_continuous', 'scale_colour_steps', 'scale_color_distiller', 'scale_colour_ordinal', 'scale_y_datetime', 'scale_linetype_discrete', 'scale_colour_viridis_b',
    'scale_alpha_datetime', 'scale_continuous_identity', 'scale_fill_brewer', 'scale_shape_identity', 'scale_color_discrete', 'scale_colour_viridis_c', 'scale_linetype_identity',
    'scale_colour_hue', 'scale_linewidth_binned', 'scale_color_hue', 'scale_shape_continuous', 'scale_colour_viridis_d', 'scale_size_continuous', 'scale_color_manual', 'scale_alpha_date',
    'scale_y_sqrt', 'scale_shape_binned', 'scale_size', 'scale_color_fermenter', 'scale_color_stepsn', 'scale_size_area', 'scale_y_binned', 'scale_y_discrete', 'scale_alpha_continuous',
    'scale_fill_continuous', 'scale_linetype_continuous', 'scale_colour_steps2', 'scale_colour_datetime', 'scale_colour_grey', 'scale_x_log10', 'scale_x_discrete', 'scale_color_continuous',
    'scale_type', 'scale_y_reverse', 'scale_colour_gradient2', 'scale_color_datetime', 'scale_color_date', 'scale_x_continuous', 'scale_colour_manual', 'scale_fill_gradient2',
    'scale_fill_grey', 'scale_colour_stepsn', 'scale_colour_binned', 'scale_color_binned', 'scale_color_gradientn', 'scale_colour_date', 'scale_fill_distiller', 'scale_color_gradient',
    'scale_linewidth_continuous', 'scale_shape', 'scale_fill_hue', 'scale_linetype', 'scale_colour_identity', 'scale_discrete_manual', 'scale_fill_identity', 'scale_y_log10',
    'scale_linetype_binned', 'scale_size_binned_area', 'scale_y_date', 'scale_x_binned', 'scale_shape_discrete', 'scale_colour_brewer', 'scale_x_date', 'scale_discrete_identity',
    'scale_alpha', 'scale_fill_steps2', 'scale_color_brewer', 'scale_fill_datetime', 'scale_shape_manual', 'scale_colour_continuous', 'scale_alpha_ordinal', 'scale_linewidth', 'scale_x_sqrt',
    'scale_fill_stepsn', 'scale_radius', 'rotateTextX', 'removeGridX', 'removeGridY', 'removeGrid',
    'coord_trans', 'coord_sf', 'coord_cartesian', 'coord_fixed', 'coord_flip', 'coord_quickmap', 'coord_equal', 'coord_map', 'coord_polar', 'coord_munch', 'coord_radial',
    'annotate', 'annotation_custom', 'annotation_raster', 'annotation_map', 'annotation_logticks', 'borders', 'ggtitle', 'expansion', 'expand_limits', 'expand_scale', 'guides',
    'wrap_by',
    'theme_solid', 'theme_hc', 'theme_excel_new', 'theme_few', 'theme_clean', 'theme_wsj', 'theme_calc', 'theme_par', 'theme_igray', 'theme_solarized_2', 'theme_excel',
    'theme_economist', 'theme_stata', 'theme_map', 'theme_fivethirtyeight', 'theme_economist_white', 'theme_base', 'theme_foundation', 'theme_gdocs', 'theme_pander', 'theme_solarized',
    'scale_shape_tableau', 'scale_fill_pander', 'scale_shape_few', 'scale_colour_excel_new', 'scale_colour_hc', 'scale_fill_ptol', 'scale_fill_gradient2_tableau', 'scale_shape_calc', 'scale_fill_stata',
    'scale_colour_tableau', 'scale_colour_colorblind', 'scale_color_stata', 'scale_colour_economist', 'scale_fill_calc', 'scale_fill_gradient_tableau', 'scale_shape_cleveland', 'scale_color_pander',
    'scale_colour_pander', 'scale_color_fivethirtyeight', 'scale_color_wsj', 'scale_shape_stata', 'scale_colour_gdocs', 'scale_color_continuous_tableau', 'scale_fill_excel', 'scale_color_few', 'scale_linetype_stata',
    'scale_shape_tremmel', 'scale_color_tableau', 'scale_color_colorblind', 'scale_fill_colorblind', 'scale_colour_stata', 'scale_fill_wsj', 'scale_colour_calc', 'scale_colour_fivethirtyeight', 'scale_fill_hc',
    'scale_shape_circlefill', 'scale_fill_excel_new', 'scale_color_solarized', 'scale_color_excel', 'scale_colour_excel', 'scale_fill_tableau', 'scale_colour_ptol', 'scale_colour_canva', 'scale_color_gradient2_tableau',
    'scale_colour_solarized', 'scale_colour_gradient2_tableau', 'scale_fill_canva', 'scale_color_ptol', 'scale_color_excel_new', 'scale_color_economist', 'scale_fill_economist', 'scale_fill_fivethirtyeight',
    'scale_colour_gradient_tableau', 'scale_colour_few', 'scale_color_calc', 'scale_fill_few', 'scale_fill_gdocs', 'scale_color_hc', 'scale_color_gdocs', 'scale_color_canva', 'scale_color_gradient_tableau',
    'scale_fill_solarized', 'scale_fill_continuous_tableau', 'scale_colour_wsj', 'gradient_color', 'ggsurvplot_add_all'
];
exports.PlotFunctionsWithAddParam = new Set([
    'map', 'matplot', 'barplot', 'boxplot', 'curve', 'image', 'plotCI', 'bandplot', 'barplot2', 'bubbleplot'
]);
exports.GraphicsPlotAddons = [
    'points', 'abline', 'mtext', 'lines', 'text', 'legend', 'title', 'axis', 'polygon', 'polypath', 'pie', 'rect', 'segments', 'arrows', 'symbols',
    'qqline', 'qqnorm', 'rasterImage',
    'tiplabels', 'rug', 'grid', 'box', 'clip', 'matpoints', 'matlines',
];
exports.GgPlotAddons = [
    'ggdraw', 'last_plot'
];
const PlotAddons = exports.GraphicsPlotAddons.concat(exports.GgPlotImplicitAddons, ...exports.PlotFunctionsWithAddParam);
const SigAtomicBinOp = [['e1', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic], ['e2', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]];
const SigAtomicX = [['x', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]];
const SigXY = [['x', built_in_props_1.ArgProp.Value], ['y', built_in_props_1.ArgProp.Value]];
const SigX = [['x', built_in_props_1.ArgProp.Value]];
/* `f(x, ...)`, the shape of most of R's summarizing and coercing functions */
const SigXDots = [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]];
/* `verb(.data, ...)`, the shape of the tidyverse verbs: the data first, the columns after */
const SigDataDots = [['.data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]];
const SigShape = [['x', built_in_props_1.ArgProp.Shape]];
const SigXTable = [['x', built_in_props_1.ArgProp.Value], ['table', built_in_props_1.ArgProp.Value]];
const SigDots = [['...', built_in_props_1.ArgProp.Value]];
/**
 * What flowR states about every function it carries a definition for, as `name -> signatures`. A name may be
 * defined for several packages (`filter` is dplyr's and cohortBuilder's), so all of them are here and the
 * caller picks by package; {@link statedSignatureOf} does that. The signature browser and the playground both
 * show this next to what a database says, so both read it from here.
 */
function statedSignatures(definitions = exports.DefaultBuiltinConfig) {
    const stated = new Map();
    for (const definition of definitions) {
        const info = definition.config;
        for (const id of definition.names) {
            const name = String(identifier_1.Identifier.getName(id));
            const pkg = String(identifier_1.Identifier.getNamespace(id) ?? "base" /* PkgName.Base */);
            const declared = (info?.sig ?? []).map(([param]) => param);
            const entry = { pkg, params: declared.length > 0 ? declared.join(', ') : undefined, props: (0, built_in_props_1.callPropWords)(info?.props) };
            const known = stated.get(name) ?? [];
            /* the last definition for a package is the one that resolves, so it is the one stated */
            stated.set(name, [...known.filter(other => other.pkg !== pkg), entry]);
        }
    }
    return stated;
}
/**
 * The one of {@link statedSignatures} a reader means: the definition for `pkg` when there is one, else base
 * R's, else whichever came first. `undefined` when flowR states nothing about the name at all.
 */
function statedSignatureOf(stated, name, pkg) {
    const known = stated.get(name);
    return known?.find(entry => entry.pkg === pkg) ?? known?.find(entry => entry.pkg === "base" /* PkgName.Base */) ?? known?.[0];
}
const RegexConvIn = /[-/\\^$*+?.()|[\]{}]/g;
/** Builds a regex from an array of plain names or namespaced {@link Identifier}s, deduplicating by name. */
function toRegex(n) {
    return new RegExp(`^(${Array.from(new Set(n.map(identifier_1.Identifier.getName)), s => s.replaceAll(RegexConvIn, String.raw `\$&`)).filter(s => s.length > 0).join('|')})$`);
}
/** what closing or exporting a device links back to: the plot calls that filled it */
const LinkToLastPlot = {
    type: 'link-to-last-call',
    callName: toRegex(GraphicDeviceOpen.concat(exports.PlotCreate, PlotAddons, exports.GgPlotAddons, exports.TinyPlotAddons))
};
const Arith = ['+', '-', '*', '/', '^', '**', '%%', '%/%'];
const Compare = ['==', '!=', '<', '<=', '>', '>='];
const Logic = ['&', '|'];
/**
 * R's group generics: a class claims every member of a group at once, with an `Ops.cls` (S3) or a
 * `setMethod('Arith', ...)` (S4), so a call to any member may dispatch to a method named after the group.
 * `Ops` is what S3 calls the union of the three S4 groups it splits into.
 */
exports.RGroupGenerics = {
    Arith, Compare, Logic,
    Ops: [...Arith, ...Compare, ...Logic, '!'],
    Math: ['abs', 'sign', 'sqrt', 'floor', 'ceiling', 'trunc', 'exp', 'expm1', 'log', 'log2', 'log10', 'log1p',
        'cos', 'sin', 'tan', 'cosh', 'sinh', 'tanh', 'acos', 'asin', 'atan', 'acosh', 'asinh', 'atanh',
        'cumsum', 'cumprod', 'cummax', 'cummin'],
    Math2: ['round', 'signif'],
    Summary: ['any', 'sum', 'prod', 'min', 'max', 'range'],
    Complex: ['Re', 'Im', 'Mod', 'Arg', 'Conj']
};
/**
 * Every R generic flowR states a built-in for: the {@link RGroupGenerics} members, the `.S3PrimitiveGenerics` and
 * internal generics (which have no R body, so {@link fnInfoFromSignature} could never see them), and the
 * `UseMethod` closures flowR models itself, as its own definition hides the one in the signature database.
 * The `<-` forms are left out, one replacement definition covers many names.
 * `npm run check:generic-labels` (part of `checkup`) compares this against a synced database.
 */
/**
 * The internal generics: they dispatch in C rather than through `UseMethod`, so no signature can state it and
 * the list has to be written down. Everything that dispatches from R is generated, see {@link RBasePackageStore}.
 */
const InternalGenerics = [
    '$', '[', '[[', '+', '-', '*', '/', '^', '%%', '%/%', '==', '!=', '<', '>', '<=', '>=', '&', '|', '!',
    'c', 'length', 'dim', 'dimnames', 'names', 'max', 'min', 'range', 'sum', 'prod', 'abs', 'sqrt', 'exp',
    'log', 'floor', 'ceiling', 'round', 'signif', 'trunc', 'cumsum', 'cumprod', 'cummax', 'cummin',
    'as.character', 'as.integer', 'as.double', 'as.logical', 'as.complex', 'as.numeric', 'as.raw',
    'is.na', 'is.nan', 'is.finite', 'is.infinite', 'is.matrix', 'is.numeric', 'cbind', 'rbind'
];
/** Every name R dispatches on: the generated closure generics plus the {@link InternalGenerics}. */
const RGenerics = new Set([...r_base_packages_generated_1.RBasePackageStore.generics, ...InternalGenerics]);
/** Label every {@link RGenerics} {@link CallProp.Generic}, splitting an entry that mixes them with names that do not dispatch (`&` does, `&&` does not). */
function markGenerics(definitions) {
    const out = [];
    for (const def of definitions) {
        if (def.type !== 'function') {
            out.push(def);
            continue;
        }
        /* the attached base packages are the ones whose namespace layer a registered built-in hides, so their
         * label is the only thing left stating the dispatch */
        let generics = undefined;
        let rest = undefined;
        for (const name of def.names) {
            if (RGenerics.has(identifier_1.Identifier.getName(name)) && r_base_packages_1.AttachedBasePackageSet.has(identifier_1.Identifier.getNamespace(name) ?? "base" /* PkgName.Base */)) {
                (generics ??= []).push(name);
            }
            else {
                (rest ??= []).push(name);
            }
        }
        if (generics === undefined) {
            out.push(def);
            continue;
        }
        out.push({ ...def, names: generics, config: { ...def.config, props: (def.config?.props ?? 0) | built_in_props_1.CallProp.Generic } });
        if (rest !== undefined) {
            out.push({ ...def, names: rest });
        }
    }
    return out;
}
/**
 * Contains the built-in definitions recognized by flowR, as they are written down: {@link DefaultBuiltinConfig}
 * is what {@link markGenerics} makes of them, and a test checks that this is all it changes.
 */
exports.WrittenBuiltinDefinitions = [
    { type: 'constant', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['NULL', 'NA', 'NA_integer_', 'NA_real_', 'NA_complex_', 'NA_character_']), value: null, assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['NaN', "base" /* PkgName.Base */])], value: NaN, assumePrimitive: true },
    { type: 'constant', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['.GlobalEnv', '.BaseNamespaceEnv', '.BaseEnv']), value: null, assumePrimitive: true },
    { type: 'constant', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['TRUE', 'T']), value: true, assumePrimitive: true },
    { type: 'constant', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['FALSE', 'F']), value: false, assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['Inf', "base" /* PkgName.Base */])], value: Infinity, assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['-Inf', "base" /* PkgName.Base */])], value: -Infinity, assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['pi', "base" /* PkgName.Base */])], value: Math.PI, assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['LETTERS', "base" /* PkgName.Base */])],
        value: Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i)), assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['letters', "base" /* PkgName.Base */])],
        value: Array.from({ length: 26 }, (_, i) => String.fromCharCode(97 + i)), assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['month.abb', "base" /* PkgName.Base */])],
        value: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], assumePrimitive: true },
    { type: 'constant', names: [identifier_1.Identifier.from(['month.name', "base" /* PkgName.Base */])],
        value: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], assumePrimitive: true },
    /* formula: operands are model terms/columns, not variables */
    {
        type: 'function',
        names: [identifier_1.Identifier.from(['~', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.All },
        assumePrimitive: false
    },
    /* cohortBuilder has a `filter` too, and built-ins go by name, so dplyr's entry below wins in the environment
       while this one still states what cohortBuilder's does */
    {
        type: 'function',
        names: [identifier_1.Identifier.from(['filter', "cohortBuilder" /* PkgName.CohortBuilder */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Pure },
        assumePrimitive: false
    },
    /* data-masking: the non-data arguments name columns of the (first) data object, not variables */
    {
        type: 'function',
        names: data_masking_functions_1.DataMaskingFunctionIdentifiers,
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure },
        assumePrimitive: false
    },
    /* slice_sample draws rows at random; registered after the block above, so this definition is the one that sticks */
    {
        type: 'function',
        names: [identifier_1.Identifier.from(['slice_sample', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Random },
        assumePrimitive: false
    },
    /* data-masking without a data argument, e.g. `aes(x, y)` */
    {
        type: 'function',
        names: [...identifier_1.Identifier.fromAll("ggplot2" /* PkgName.GgPlot2 */, ['aes', 'vars']), identifier_1.Identifier.from(['join_by', "dplyr" /* PkgName.Dplyr */]),
            ...identifier_1.Identifier.fromAll("tibble" /* PkgName.Tibble */, ['tibble', 'tribble'])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.All },
        assumePrimitive: false
    },
    /* an {@link BuiltInEvalName} marks what the value solver folds; a test checks the names against the handler tables */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['+', '-', '*', '/', '^', '**', '%%', '%/%']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['==', '!=', '>', '<', '>=', '<=']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicBinOp }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Comparison },
    { type: 'function', names: [identifier_1.Identifier.from(['%*%', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXY }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['%in%', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXTable }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from([':', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['from', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic], ['to', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Atomic]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Seq },
    { type: 'function', names: [identifier_1.Identifier.from(['!', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigAtomicX }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
    { type: 'function', names: [identifier_1.Identifier.from(['?', "utils" /* PkgName.Utils */])], /* shows the help page of what it is given */
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { sig: [['e1', built_in_props_1.ArgProp.Nse], ['e2', built_in_props_1.ArgProp.Nse]] }, assumePrimitive: true },
    /* the result follows from how large the argument is, not from what is in it, so it is bounded (`Narrows`) */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['length', 'lengths', 'nrow', 'ncol', 'NROW', 'NCOL', 'dim', 'is.null', 'is.factor', 'is.vector', 'is.matrix', 'is.data.frame', 'is.numeric', 'is.character', 'is.logical', 'is.function', 'is.list']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: SigShape }, assumePrimitive: true },
    /* the names and the class are read off the argument, so whatever it carries can show up in the result */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['dimnames', 'names', 'rownames', 'colnames', 'class']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigShape }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['nchar', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: SigShape }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: [identifier_1.Identifier.from(['missing', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Presence]] }, assumePrimitive: true },
    /* they fold everything they are handed into one result */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['sum', 'prod', 'min', 'max', 'range', 'pmin', 'pmax', 'cbind', 'rbind', 'data.frame', 'order', 'any']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigDots }, assumePrimitive: true },
    /* the separator sits behind the `...`, so R (and the {@link FnSig}) only ever matches it by its full name */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['paste', 'paste0']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['...', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: [identifier_1.Identifier.from(['file.path', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['...', built_in_props_1.ArgProp.Value], ['fsep', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    /* `here` joins its arguments below the project root, which stays implicit */
    { type: 'function', names: [identifier_1.Identifier.from(['here', "here" /* PkgName.Here */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { libFn: true, props: built_in_props_1.CallProp.Pure, sig: [['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    /* `x` carries the data, whatever follows only tunes the result */
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, [
                /* `mean` reduces a vector, so unlike its neighbors below the value solver cannot fold it */
                'mean',
                /* running summaries & reordering */
                'cumsum', 'cumprod', 'cummax', 'cummin', 'diff', 'sort', 'rev', 'unique', 'duplicated', 't',
                /* coercion */
                'as.character', 'as.integer', 'as.logical', 'as.numeric', 'as.matrix', 'as.data.frame',
                'as.factor', 'as.raw', 'as.list', 'as.array', 'as.double', 'as.complex', 'factor'
            ]),
            ...identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['head', 'tail']),
            ...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, ['var', 'sd', 'median', 'quantile']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: SigXDots },
        assumePrimitive: true
    },
    /* they read the values but answer only with a logical, so nothing those values carry reaches the result */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['is.na', 'nzchar', 'is.finite', 'is.infinite', 'is.nan']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: SigX }, assumePrimitive: true },
    /* the numeric functions the value solver folds; each one is an entry of `NumericFns`, which states its parameters */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['sqrt', 'abs', 'floor', 'ceiling', 'trunc', 'sign', 'exp', 'expm1', 'log2', 'log10', 'log1p',
            'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'sinh', 'cosh', 'tanh', 'asinh', 'acosh', 'atanh']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigX }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['round', 'signif']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['digits', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: [identifier_1.Identifier.from(['log', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['base', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['tolower', 'toupper', 'trimws']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigX }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['basename', 'dirname']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['path', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Re', 'Im', 'Mod', 'Arg', 'Conj']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['z', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the vector constructors take the length of the result, not its contents */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['numeric', 'character', 'logical', 'integer', 'double', 'raw']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['length', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['na.omit', "stats" /* PkgName.Stats */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['object', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* two data arguments, under the names R gives them */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['xor', 'crossprod', 'tcrossprod', 'intersect', 'union', 'setdiff']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXY }, assumePrimitive: true },
    /* they answer with a position or a logical, never with what they matched */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['match', 'pmatch', 'charmatch']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: SigXTable }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['is.element', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['el', built_in_props_1.ArgProp.Value], ['set', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the result is one of the `choices`, so what flows in is bounded by that argument */
    { type: 'function', names: [identifier_1.Identifier.from(['match.arg', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['arg', built_in_props_1.ArgProp.Value], ['choices', built_in_props_1.ArgProp.Bounds]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['atan2', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['y', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['bitwAnd', 'bitwOr', 'bitwXor']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['a', built_in_props_1.ArgProp.Value], ['b', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['bitwShiftL', 'bitwShiftR']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['a', built_in_props_1.ArgProp.Value], ['n', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: [identifier_1.Identifier.from(['bitwNot', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['a', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Numeric },
    { type: 'function', names: [identifier_1.Identifier.from(['grepl', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['pattern', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['startsWith', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Value], ['prefix', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['endsWith', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Value], ['suffix', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the rest of the pure computations, where no single shape fits */
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, [
                'rep', 'rep.int', 'seq', 'seq.int', 'append', 'complex',
                'matrix', 'array', 'table', 'prop.table', 'colSums', 'rowSums', 'colMeans', 'rowMeans',
                'solve', 'det', 'eigen', 'aperm',
                /* string */
                'grep', 'sub', 'gsub', 'substr', 'substring', 'strsplit', 'strrep', 'chartr', 'strtoi',
                'regexpr', 'gregexpr', 'regexec', 'format', 'sprintf', 'formatC',
                /* regmatches yields a substring of its subject, so what flows in flows out */
                'regmatches'
            ]),
            ...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, ['cor', 'cov', 'xtabs']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure },
        assumePrimitive: true
    },
    /* indices and index sequences: bounded by the shape of what they are handed, never by its contents */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['which', 'which.max', 'which.min', 'seq_len', 'seq_along']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows }, assumePrimitive: true },
    /* they open a device that writes the plot to the file they are given, under the name each of them uses */
    { type: 'function', names: [...identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['png', 'jpeg', 'bmp', 'tiff', 'svg', 'cairo_pdf']), identifier_1.Identifier.from(['raster_pdf', "rasterpdf" /* PkgName.RasterPdf */]), ...identifier_1.Identifier.fromAll("ragg" /* PkgName.Ragg */, ['agg_png', 'agg_jpeg', 'agg_tiff', 'agg_ppm', 'agg_webp'])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['filename', built_in_props_1.ArgProp.Resource], ['width', built_in_props_1.ArgProp.Value], ['height', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['pdf', 'postscript', 'xfig', 'bitmap', 'pictex']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource], ['type', built_in_props_1.ArgProp.Value], ['height', built_in_props_1.ArgProp.Value], ['width', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* devices that draw on the screen or into memory instead */
    { type: 'function', names: [...identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['X11', 'windows', 'quartz', 'dev.new']), identifier_1.Identifier.from(['trellis.device', "lattice" /* PkgName.Lattice */]), ...identifier_1.Identifier.fromAll("magick" /* PkgName.Magick */, ['image_graph', 'image_draw'])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Graphics }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['read.csv', "utils" /* PkgName.Utils */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource], ['header', built_in_props_1.ArgProp.Flag], ['sep', built_in_props_1.ArgProp.Value], ['quote', built_in_props_1.ArgProp.Value], ['dec', built_in_props_1.ArgProp.Value], ['fill', built_in_props_1.ArgProp.Flag], ['comment.char', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['scan', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.User, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    /* the connections and the calls that move data through them, so anything reaching them inherits it */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['file', 'gzfile', 'bzfile', 'xzfile', 'unz', 'fifo']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.Writes, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['url', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['socketConnection', 'serverSocket']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Network | built_in_props_1.CallProp.Reads, sig: [['host', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['textConnection', 'rawConnection']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Opens, sig: [['object', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['dbConnect', "DBI" /* PkgName.Dbi */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { libFn: true, props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Database }, assumePrimitive: false },
    /* the calls ending what an opener started, each stating the argument holding the handle */
    { type: 'function', names: [identifier_1.Identifier.from(['close', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Generic, sig: [['con', built_in_props_1.ArgProp.Handle], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['closeAllConnections', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['dbDisconnect', "DBI" /* PkgName.Dbi */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { libFn: true, props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Database, sig: [['conn', built_in_props_1.ArgProp.Handle], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    /* withr closes the connection it is handed when the scope it is called in ends */
    { type: 'function', names: [identifier_1.Identifier.from(['local_connection', "withr" /* PkgName.Withr */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { libFn: true, props: built_in_props_1.CallProp.Closes, sig: [['con', built_in_props_1.ArgProp.Handle], ['.local_envir', built_in_props_1.ArgProp.Written]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['with_connection', "withr" /* PkgName.Withr */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { libFn: true, props: built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.MayPure, sig: [['con', built_in_props_1.ArgProp.Handle], ['code', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['readLines', 'readBin', 'readChar']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['con', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['readRDS', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['writeLines', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes | built_in_props_1.CallProp.Prints, sig: [['text', built_in_props_1.ArgProp.Value], ['con', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['writeBin', 'writeChar']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['object', built_in_props_1.ArgProp.Value], ['con', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['saveRDS', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['object', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['save', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['...', built_in_props_1.ArgProp.Value], ['list', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['save.image', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['dput', 'write']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes | built_in_props_1.CallProp.Prints, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['write.dcf', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['write.table', "utils" /* PkgName.Utils */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['write.csv', 'write.csv2']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['read.table', 'read.delim', 'read.csv2', 'read.delim2']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['download.file', "utils" /* PkgName.Utils */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['url', built_in_props_1.ArgProp.Resource], ['destfile', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['jitter', "stats" /* PkgName.Stats */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Random }, assumePrimitive: true },
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['sample', 'sample.int']),
            ...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, [
                'runif', 'rnorm', 'rbinom', 'rpois', 'rexp', 'rgamma', 'rbeta', 'rcauchy', 'rchisq', 'rgeom',
                'rhyper', 'rlnorm', 'rlogis', 'rmultinom', 'rnbinom', 'rsignrank', 'rt', 'rf', 'rweibull',
                'rwilcox', 'arima.sim', 'simulate', 'kmeans'
            ])
        ],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Random },
        assumePrimitive: false
    },
    { type: 'function', names: [identifier_1.Identifier.from(['expression', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Lang }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['rm', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Rm, config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: true },
    /* they read the state they set, so both bits apply */
    { type: 'function', names: [identifier_1.Identifier.from(['options', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: 'all', props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Ambient | built_in_props_1.CallProp.Configures }, assumePrimitive: false },
    /* `Sys.putenv` is defunct in current R, older scripts still use it */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Sys.setenv', 'Sys.unsetenv', 'Sys.setlocale', 'Sys.putenv', 'Sys.setLanguage']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: 'all', props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Configures }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['mapply', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['Mapply', "functools" /* PkgName.Functools */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['FUN', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['lapply', 'sapply', 'vapply']),
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['X', built_in_props_1.ArgProp.Value], ['FUN', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    /* `vapply` takes the shape of the result before its `...`, so naming it keeps the positions honest */
    { type: 'function', names: [identifier_1.Identifier.from(['vapply', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['X', built_in_props_1.ArgProp.Value], ['FUN', built_in_props_1.ArgProp.Callee], ['FUN.VALUE', built_in_props_1.ArgProp.Shape], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("functools" /* PkgName.Functools */, ['Lapply', 'Sapply', 'Vapply']),
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: [...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['apply', 'tapply']), identifier_1.Identifier.from(['Tapply', "functools" /* PkgName.Functools */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 2, nameOfFunctionArgument: 'FUN', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['Map', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['Filter', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['x', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Find', 'Position']),
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee], ['x', built_in_props_1.ArgProp.Value], ['right', built_in_props_1.ArgProp.Flag], ['nomatch', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['Reduce', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['f', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['rapply', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'f', unquoteFunction: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['print', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Generic | built_in_props_1.CallProp.Prints, sig: [['x', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced], ['...', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
    { type: 'function', names: [...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['message', 'warning']), identifier_1.Identifier.from(['warn', "rlang" /* PkgName.Rlang */]), identifier_1.Identifier.from(['warn', "R.utils" /* PkgName.Rutils */]), identifier_1.Identifier.from(['info', "msgr" /* PkgName.Msgr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Prints, sig: [['...', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['invisible', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Invisible, sig: [['x', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['force', 'identity']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', keepArgumentOut: true, props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Alias | built_in_props_1.ArgProp.Forced]] }, assumePrimitive: false },
    // graphics base
    { type: 'function', names: namespacePlotFunctions(exports.PlotCreate),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: {
            forceArgs: 'all',
            hasUnknownSideEffects: {
                type: 'link-to-last-call',
                ignoreIf: (source, graph) => {
                    const sourceVertex = graph.getVertex(source);
                    /* map with add = true appends to an existing plot */
                    return (exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(sourceVertex.name)) && (0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, sourceVertex, {
                        index: -1,
                        name: 'add'
                    }, [type_1.RType.Logical])?.content === true);
                },
                callName: toRegex(GraphicDeviceOpen)
            },
            props: built_in_props_1.CallProp.Graphics
        }, assumePrimitive: true },
    // graphics addons
    { type: 'function', names: namespacePlotFunctions(PlotAddons),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: {
            forceArgs: 'all',
            treatAsFnCall: {
                'facet_grid': ['labeller']
            },
            hasUnknownSideEffects: {
                type: 'link-to-last-call',
                callName: toRegex(exports.PlotCreate.concat(PlotAddons)),
                ignoreIf: (source, graph) => {
                    const sourceVertex = graph.getVertex(source);
                    /* map with add = true appends to an existing plot */
                    return (exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(sourceVertex.name)) && (0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, sourceVertex, {
                        index: -1,
                        name: 'add'
                    }, [type_1.RType.Logical])?.content !== true);
                },
                cascadeIf: (targetVertex, _, graph) => {
                    const target = targetVertex;
                    /* map with add = true appends to an existing plot */
                    return identifier_1.Identifier.getName(target.name) ? ((0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, target, {
                        index: 11,
                        name: 'add'
                    }, [type_1.RType.Logical])?.content === true ? cascade_action_1.CascadeAction.Continue : cascade_action_1.CascadeAction.Stop) : cascade_action_1.CascadeAction.Stop;
                }
            },
            props: built_in_props_1.CallProp.Graphics
        }, assumePrimitive: true },
    // plot tags
    {
        type: 'function',
        names: namespacePlotFunctions(exports.GgPlotAddons),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: {
            libFn: true,
            forceArgs: 'all',
            hasUnknownSideEffects: {
                type: 'link-to-last-call',
                callName: toRegex(exports.GgPlotCreate.concat(exports.GgPlotAddons))
            },
            props: built_in_props_1.CallProp.Graphics
        }, assumePrimitive: true
    },
    {
        type: 'function',
        names: namespacePlotFunctions(exports.TinyPlotAddons),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: {
            libFn: true,
            forceArgs: 'all',
            hasUnknownSideEffects: {
                type: 'link-to-last-call',
                callName: toRegex([...exports.TinyPlotCrate, ...exports.TinyPlotAddons])
            },
            props: built_in_props_1.CallProp.Graphics
        }, assumePrimitive: true
    },
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("magick" /* PkgName.Magick */, ['image_capture']),
            ...identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['dev.capture'])
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, forceArgs: 'all', hasUnknownSideEffects: LinkToLastPlot, props: built_in_props_1.CallProp.Graphics },
        assumePrimitive: true
    },
    /* they put what the device holds on disk */
    { type: 'function', names: [identifier_1.Identifier.from(['image_write', "magick" /* PkgName.Magick */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, forceArgs: 'all', hasUnknownSideEffects: LinkToLastPlot, props: built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['image', built_in_props_1.ArgProp.Value], ['path', built_in_props_1.ArgProp.Resource]] },
        assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("grDevices" /* PkgName.GrDevices */, ['dev.off', 'graphics.off']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, forceArgs: 'all', hasUnknownSideEffects: LinkToLastPlot, props: built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.Closes | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes },
        assumePrimitive: true },
    { type: 'function', names: ['('],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { keepArgumentOut: true, props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Alias]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Group },
    { type: 'function', names: [identifier_1.Identifier.from(['load_all', "pkgload" /* PkgName.PkgLoad */]), identifier_1.Identifier.from(['load_all', "devtools" /* PkgName.Devtools */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true], props: built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['setwd', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true], props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Ambient | built_in_props_1.CallProp.Configures }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['set.seed', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true], props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Random | built_in_props_1.CallProp.Configures }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['body', 'formals']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true], props: built_in_props_1.CallProp.Lang }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['environment', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: true },
    {
        type: 'function',
        names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['.Call', '.External', '.C', '.Fortran']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: {
            hasUnknownSideEffects: true,
            forceArgs: [true],
            /* the routine usually comes from useDynLib, but it may be a variable holding a symbol */
            markArgsAsMasked: known_call_handling_1.NseArguments.First,
            treatAsFnCall: {
                '.Call': ['.NAME'],
                '.External': ['.NAME'],
                '.C': ['.NAME'],
                '.Fortran': ['.NAME']
            },
            props: built_in_props_1.CallProp.Ffi
        },
        assumePrimitive: true
    },
    { type: 'function', names: [identifier_1.Identifier.from(['eval', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Eval, config: { includeFunctionCall: true, supportFunctionCall: false, keepEnvironment: true }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['evalText', "SoDA" /* PkgName.Soda */])],
        processor: built_in_proc_name_1.BuiltInProcName.Eval, config: { includeFunctionCall: true, supportFunctionCall: true, keepEnvironment: true }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['cat', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes | built_in_props_1.CallProp.Prints, sig: [['...', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['switch', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: [true], useAsProcessor: built_in_proc_name_1.BuiltInProcName.Switch, props: built_in_props_1.CallProp.Pure }, assumePrimitive: false },
    { type: 'function', names: ['return'],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { cfg: 1 /* ExitPointType.Return */, keepArgumentOut: true, useAsProcessor: built_in_proc_name_1.BuiltInProcName.Return, props: built_in_props_1.CallProp.Pure, sig: [['value', built_in_props_1.ArgProp.Alias]] }, assumePrimitive: true },
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['stop', "base" /* PkgName.Base */]),
            identifier_1.Identifier.from(['abort', "rlang" /* PkgName.Rlang */]), identifier_1.Identifier.from(['cli_abort', "cli" /* PkgName.Cli */]),
            identifier_1.Identifier.from(['throw', "R.methodsS3" /* PkgName.RmethodsS3 */]), identifier_1.Identifier.from(['throw', "R.oo" /* PkgName.Roo */]), /* R.oo re-exports R.methodsS3::throw */
            ...identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['stop_bad_type', 'stop_bad_element_type', 'stop_bad_element_length'])
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { useAsProcessor: built_in_proc_name_1.BuiltInProcName.Stop, cfg: 4 /* ExitPointType.Error */, forceArgs: 'all', props: built_in_props_1.CallProp.Throws },
        assumePrimitive: false
    },
    { type: 'function', names: [identifier_1.Identifier.from(['try', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Try, config: { block: 'expr', handlers: {} }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['tryCatch', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['tryCatchLog', "tryCatchLog" /* PkgName.TryCatchLog */])],
        processor: built_in_proc_name_1.BuiltInProcName.Try, config: { block: 'expr', handlers: { error: 'error', finally: 'finally' } }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['stopifnot', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['assert_that', "assertthat" /* PkgName.AssertThat */])],
        processor: built_in_proc_name_1.BuiltInProcName.StopIfNot, config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Throws }, assumePrimitive: false },
    { type: 'function', names: ['break'],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { useAsProcessor: built_in_proc_name_1.BuiltInProcName.Break, cfg: 2 /* ExitPointType.Break */ }, assumePrimitive: false },
    { type: 'function', names: ['next'],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { cfg: 3 /* ExitPointType.Next */ }, assumePrimitive: false },
    { type: 'function', names: ['{'],
        processor: built_in_proc_name_1.BuiltInProcName.ExpressionList, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['source', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Source, config: { includeFunctionCall: true, forceFollow: false }, assumePrimitive: false },
    { type: 'function', names: ['['],
        processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
    { type: 'function', names: ['[['],
        processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: false, resolveField: true, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
    { type: 'function', names: ['$', '@'],
        processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: true, resolveField: true, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
    { type: 'function', names: ['::'],
        processor: built_in_proc_name_1.BuiltInProcName.NamespaceAccess, config: { internal: false }, assumePrimitive: true },
    { type: 'function', names: [':::'],
        processor: built_in_proc_name_1.BuiltInProcName.NamespaceAccess, config: { internal: true }, assumePrimitive: true },
    { type: 'function', names: ['if'],
        processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['ifelse', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['fifelse', "data.table" /* PkgName.DataTable */]), 'IfElse'],
        processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: { args: { cond: 'test', yes: 'yes', no: 'no' }, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['if_else', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: { args: { cond: 'condition', yes: 'true', no: 'false' }, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['get', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Get, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['pos', built_in_props_1.ArgProp.Flag], ['envir', built_in_props_1.ArgProp.Value], ['mode', built_in_props_1.ArgProp.Flag], ['inherits', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['library', 'require']),
        processor: built_in_proc_name_1.BuiltInProcName.Library, config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['attachNamespace', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Library, config: { characterOnly: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['requireNamespace', 'loadNamespace']),
        processor: built_in_proc_name_1.BuiltInProcName.Library, config: { namespaceOnly: true, characterOnly: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['from', "import" /* PkgName.Import */])],
        processor: built_in_proc_name_1.BuiltInProcName.Library, config: { fromImports: true, props: built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['use', "box" /* PkgName.Box */]), identifier_1.Identifier.from(['use', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Library, config: { boxUse: true, props: built_in_props_1.CallProp.Scope }, assumePrimitive: false },
    { type: 'function', names: ['<-', '='],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { canBeReplacement: true, props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from([':=', "data.table" /* PkgName.DataTable */])],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['assign', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { targetVariable: true, mayHaveMoreArgs: true, environmentArg: 'envir', props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible, sig: [['x', built_in_props_1.ArgProp.Value], ['value', built_in_props_1.ArgProp.Value], ['pos', built_in_props_1.ArgProp.Flag], ['envir', built_in_props_1.ArgProp.Written], ['inherits', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['setValidity', "methods" /* PkgName.Methods */])],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { targetVariable: true, mayHaveMoreArgs: true, environmentArg: 'envir', props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['setMethod', "methods" /* PkgName.Methods */])],
        processor: built_in_proc_name_1.BuiltInProcName.AssignmentLike,
        config: { targetVariable: true, canBeReplacement: false, target: { idx: 0, name: 'f' }, source: { idx: 2, name: 'definition' }, modesForFn: ['s4'] },
        assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['delayedAssign', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { quoteSource: true, targetVariable: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: true },
    { type: 'function', names: ['<<-'],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { superAssignment: true, canBeReplacement: true, props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible }, assumePrimitive: true },
    { type: 'function', names: ['->'],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { swapSourceAndTarget: true, canBeReplacement: true, props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible }, assumePrimitive: true },
    { type: 'function', names: ['->>'],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { superAssignment: true, swapSourceAndTarget: true, canBeReplacement: true, props: built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.Invisible }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['data', "utils" /* PkgName.Utils */]), identifier_1.Identifier.from(['getHdata', "Hmisc" /* PkgName.Hmisc */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefineArgument, config: { superAssignment: true }, assumePrimitive: false },
    /* only `&&`/`||` short-circuit */
    { type: 'function', names: [identifier_1.Identifier.from(['&&', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: true, evalRhsWhen: true, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
    { type: 'function', names: [identifier_1.Identifier.from(['||', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: true, evalRhsWhen: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['&', '|']),
        processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
    { type: 'function', names: ['|>'],
        processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '_', assignLhs: false, returnLhs: false }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['%>%', "magrittr" /* PkgName.Magrittr */]), '%!>%'], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: false, rhsMightBeSymbol: true }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['%<>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: true, returnLhs: false, rhsMightBeSymbol: true }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['%T>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: true, rhsMightBeSymbol: true }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map', 'map_lgl', 'map_int', 'map_dbl', 'map_chr']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress']
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['pmap', 'pmap_lgl', 'pmap_int', 'pmap_dbl', 'pmap_chr']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.l': { index: 0, name: '.l' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress']
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map2', 'map2_lgl', 'map2_int', 'map2_dbl', 'map2_chr']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.y': { index: 1, name: '.y' },
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.progress']
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['modify', 'imodify', 'imap', 'imap_lgl', 'imap_int', 'imap_dbl', 'imap_chr', 'imap_vec', 'lmap']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: []
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['modify2', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.y': { index: 1, name: '.y' }
            },
            '.f': { index: 2, name: '.f' },
            ignore: []
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map_at', 'modify_at']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.at': { index: 1, name: '.at' },
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.progress']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['lmap_at', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.at': { index: 1, name: '.at' },
            },
            '.f': { index: 2, name: '.f' },
            ignore: []
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map_if', 'modify_if', 'lmap_if']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.p': { index: 1, name: '.p' },
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.else']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['walk', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress'],
            returnArg: '.x'
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['iwalk', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: [],
            returnArg: '.x'
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['pwalk', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.l': { index: 0, name: '.l' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress'],
            returnArg: '.l'
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['walk2', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.y': { index: 1, name: '.y' }
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.progress'],
            returnArg: '.x'
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['map_vec', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress', '.ptype']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['pmap_vec', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.l': { index: 0, name: '.l' }
            },
            '.f': { index: 1, name: '.f' },
            ignore: ['.progress', '.ptype']
        } },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map_depth', 'modify_depth']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.depth': { index: 2, name: '.depth' }
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.ragged', '.is_node']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['map2_vec', "purrr" /* PkgName.Purrr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.x' },
                '.y': { index: 1, name: '.y' }
            },
            '.f': { index: 2, name: '.f' },
            ignore: ['.progress', '.ptype']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['across', "dplyr" /* PkgName.Dplyr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.cols' },
            },
            '.f': { index: 1, name: '.fns' },
            ignore: ['.names', '.unpack']
        } },
    { type: 'function', names: [identifier_1.Identifier.from(['rename_with', "dplyr" /* PkgName.Dplyr */])], processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
            args: {
                '.x': { index: 0, name: '.data' },
            },
            '.f': { index: 1, name: '.fn' },
            ignore: ['.cols']
        } },
    { type: 'function', names: ['function', '\\'],
        processor: built_in_proc_name_1.BuiltInProcName.FunctionDefinition, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['quote', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Quote, config: { quoteArgumentsWithIndex: 0, keepEnvironment: true, props: built_in_props_1.CallProp.Lang, sig: [['expr', built_in_props_1.ArgProp.Nse]] }, assumePrimitive: true },
    /* `bquote` evaluates the operand of `.()` */
    { type: 'function', names: [identifier_1.Identifier.from(['bquote', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Quote, config: { quoteArgumentsWithIndex: 0, unquote: nse_1.Unquote.Bquote, keepEnvironment: true, props: built_in_props_1.CallProp.Lang, sig: [['expr', built_in_props_1.ArgProp.Nse]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['substitute', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Quote, config: { quoteArgumentsWithIndex: 0, envArgIndex: 1, keepEnvironment: true, props: built_in_props_1.CallProp.Lang, sig: [['expr', built_in_props_1.ArgProp.Nse], ['env', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the rlang functions that capture unevaluated, the rest take a value */
    { type: 'function', names: identifier_1.Identifier.fromAll("rlang" /* PkgName.Rlang */, ['quo', 'quos', 'expr', 'exprs']), processor: built_in_proc_name_1.BuiltInProcName.Quote, config: { quoteArgumentsWithIndex: 0, unquote: nse_1.Unquote.Rlang, keepEnvironment: true, libFn: true, props: built_in_props_1.CallProp.Lang }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['exec', "rlang" /* PkgName.Rlang */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: '.fn', unquoteFunction: true, hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.MayPure, sig: [['.fn', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['invoke', 'invoke_map']),
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: '.f', unquoteFunction: true, hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.MayPure, sig: [['.f', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    /* the `{...}` of a template holds R code, evaluated where the call is; `cli_abort` stays with the other
     * error exits, as terminating a branch matters more than interpolating its message */
    { type: 'function', names: [...identifier_1.Identifier.fromAll("glue" /* PkgName.Glue */, ['glue', 'glue_safe', 'glue_collapse']), identifier_1.Identifier.from(['str_glue', "stringr" /* PkgName.Stringr */])],
        processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("cli" /* PkgName.Cli */, ['cli_text', 'cli_alert', 'cli_alert_info', 'cli_alert_success',
            'cli_alert_warning', 'cli_alert_danger', 'cli_h1', 'cli_h2', 'cli_h3', 'cli_li', 'cli_bullets', 'cli_inform', 'cli_warn',
            'format_inline', 'cli_verbatim']),
        processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { markup: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['str_interp', "stringr" /* PkgName.Stringr */])],
        processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { open: '${', props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['local', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Local, config: { args: { env: 'envir', expr: 'expr' } }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['with', 'within']),
        processor: built_in_proc_name_1.BuiltInProcName.With, config: {}, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['new.env', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['new_environment', "rlang" /* PkgName.Rlang */])],
        processor: built_in_proc_name_1.BuiltInProcName.NewEnv, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['R6Class', "R6" /* PkgName.R6 */]), identifier_1.Identifier.from(['setRefClass', "methods" /* PkgName.Methods */])],
        processor: built_in_proc_name_1.BuiltInProcName.ClassGenerator, config: {}, assumePrimitive: false },
    /* env-returning builtins pointing into the current search-path stack (`e <- globalenv(); e$x`) */
    { type: 'function', names: Object.entries(exports.StackEnvBuiltins)
            .filter(([n, kind]) => !n.startsWith('.') && (kind === StackEnvKind.Global || kind === StackEnvKind.Base || kind === StackEnvKind.Empty))
            .map(([n]) => identifier_1.Identifier.from([n, "base" /* PkgName.Base */])),
        processor: built_in_proc_name_1.BuiltInProcName.StackEnv, config: {}, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['parent.env', 'parent.frame', 'environmentName', 'as.environment', 'pos.to.env', 'sys.frame', 'sys.frames', 'topenv']), processor: built_in_proc_name_1.BuiltInProcName.Default, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['load', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Load,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    /* attach injects an environment's contents into the search path; detach reverses it (treated as unknown side effect) */
    { type: 'function', names: [identifier_1.Identifier.from(['attach', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Attach, config: {}, assumePrimitive: false },
    { type: 'function', names: ['for'], processor: built_in_proc_name_1.BuiltInProcName.ForLoop, config: {}, assumePrimitive: true },
    { type: 'function', names: ['repeat'], processor: built_in_proc_name_1.BuiltInProcName.RepeatLoop, config: {}, assumePrimitive: true },
    { type: 'function', names: ['while'], processor: built_in_proc_name_1.BuiltInProcName.WhileLoop, config: {}, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['do.call', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, unquoteFunction: true, props: built_in_props_1.CallProp.MayPure, sig: [['what', built_in_props_1.ArgProp.Callee], ['args', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['UseMethod', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.S3Dispatch, config: { args: { generic: 'generic', object: 'object' }, props: built_in_props_1.CallProp.Generic }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['NextMethod', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.S3Dispatch, config: { args: { generic: 'generic', object: 'object' }, inferFromClosure: true, props: built_in_props_1.CallProp.Generic }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['new_generic', "S7" /* PkgName.S7 */])],
        processor: built_in_proc_name_1.BuiltInProcName.S7NewGeneric, config: { args: { name: 'name', dispatchArg: 'dispatch_args', fun: 'fun' } }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['setGeneric', "methods" /* PkgName.Methods */])],
        processor: built_in_proc_name_1.BuiltInProcName.S7NewGeneric, config: { args: { name: 'name', dispatchArg: undefined, fun: 'fun' } }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['S7_dispatch', "S7" /* PkgName.S7 */])],
        processor: built_in_proc_name_1.BuiltInProcName.S7Dispatch, config: { libFn: true }, assumePrimitive: true },
    { type: 'function', names: [
            identifier_1.Identifier.from(['make_constructor', "ggplot2" /* PkgName.GgPlot2 */]),
            identifier_1.Identifier.from(['new_class', "S7" /* PkgName.S7 */])
        ], processor: built_in_proc_name_1.BuiltInProcName.S7MakeConstructor, config: { mode: ['s7'] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['setClass', "methods" /* PkgName.Methods */])],
        processor: built_in_proc_name_1.BuiltInProcName.S7MakeConstructor, config: { mode: ['s4'] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['Negate', "base" /* PkgName.Base */])], processor: built_in_proc_name_1.BuiltInProcName.S7MakeConstructor, config: { wrapIndex: 0, props: built_in_props_1.CallProp.Pure, sig: [['f', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['Vectorize', "base" /* PkgName.Base */])], processor: built_in_proc_name_1.BuiltInProcName.S7MakeConstructor, config: { wrapIndex: 0, props: built_in_props_1.CallProp.Pure, sig: [['FUN', built_in_props_1.ArgProp.Callee]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['partial', "purrr" /* PkgName.Purrr */])],
        processor: built_in_proc_name_1.BuiltInProcName.S7MakeConstructor, config: { wrapIndex: 0, wrapName: '.f' }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['.Primitive', '.Internal']),
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, unquoteFunction: true, resolveInEnvironment: 'global' }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['interference', "inferference" /* PkgName.Inferference */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { unquoteFunction: true, nameOfFunctionArgument: 'propensity_integrand', libFn: true }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['ddply', "plyr" /* PkgName.Plyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { unquoteFunction: true, indexOfFunction: 2, nameOfFunctionArgument: '.fun', libFn: true }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['list', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.List, config: { props: built_in_props_1.CallProp.Pure, sig: [['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['Recall', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Recall, config: { libFn: true }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['sys.function', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Recall, config: { libFn: true, unknownOnNonZeroArg: true, props: built_in_props_1.CallProp.Lang }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['c', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Vector, config: { props: built_in_props_1.CallProp.Pure, sig: [['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Vector },
    { type: 'function', names: [identifier_1.Identifier.from(['cmpfun', "compiler" /* PkgName.Compiler */])], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { sig: [['f', built_in_props_1.ArgProp.Alias]] } },
    { type: 'function', names: [identifier_1.Identifier.from(['compile', "compiler" /* PkgName.Compiler */])], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { sig: [['e', built_in_props_1.ArgProp.Alias]] } },
    { type: 'function', names: [identifier_1.Identifier.from(['loadcmp', "compiler" /* PkgName.Compiler */])], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true } },
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['setnames', "data.table" /* PkgName.DataTable */]), identifier_1.Identifier.from(['setNames', "base" /* PkgName.Base */]),
            ...identifier_1.Identifier.fromAll("data.table" /* PkgName.DataTable */, ['setkey', 'setkeyv', 'setindex', 'setindexv', 'setattr'])
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Assignment,
        config: {
            canBeReplacement: false,
            targetVariable: false,
            makeMaybe: true,
            mayHaveMoreArgs: true
        }
    },
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['sys.on.exit', "base" /* PkgName.Base */]),
            /* library/require/(require|load|attach)Namespace/use are handled above */
            identifier_1.Identifier.from(['asNamespace', "base" /* PkgName.Base */]),
            identifier_1.Identifier.from(['unname', "base" /* PkgName.Base */]),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { hasUnknownSideEffects: true },
        assumePrimitive: false
    },
    /* they create, move, or delete files */
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['dir.create', "base" /* PkgName.Base */]), identifier_1.Identifier.from(['dir_create', "fs" /* PkgName.Fs */]),
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['Sys.chmod', 'unlink', 'file.remove', 'file.rename', 'file.copy', 'file.link', 'file.append', 'Sys.junction']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { hasUnknownSideEffects: true, props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes },
        assumePrimitive: false
    },
    /* `sink` diverts the output, `par`/`tpar` set the parameters of the current device */
    { type: 'function', names: [identifier_1.Identifier.from(['sink', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['par', "graphics" /* PkgName.Graphics */]), identifier_1.Identifier.from(['tpar', "tinyplot" /* PkgName.TinyPlot */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, props: built_in_props_1.CallProp.Graphics }, assumePrimitive: false },
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['tinytheme', "tinyplot" /* PkgName.TinyPlot */]), identifier_1.Identifier.from(['theme_set', "ggplot2" /* PkgName.GgPlot2 */]),
            identifier_1.Identifier.from(['context', "testthat" /* PkgName.Testthat */]), identifier_1.Identifier.from(['library.dynam', "base" /* PkgName.Base */]),
            /* installs from a path that is already there */
            identifier_1.Identifier.from(['install_local', "remotes" /* PkgName.Remotes */]), identifier_1.Identifier.from(['install_local', "devtools" /* PkgName.Devtools */]),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { hasUnknownSideEffects: true, libFn: true },
        assumePrimitive: false
    },
    /* installers fetch the package and put it into the library (devtools re-exports the entire remotes install API) */
    {
        type: 'function',
        names: [
            identifier_1.Identifier.from(['install.packages', "utils" /* PkgName.Utils */]), identifier_1.Identifier.from(['install', "devtools" /* PkgName.Devtools */]),
            ...['install_github', 'install_gitlab', 'install_bitbucket', 'install_url', 'install_git', 'install_svn', 'install_version', 'update_packages']
                .flatMap(f => [identifier_1.Identifier.from([f, "remotes" /* PkgName.Remotes */]), identifier_1.Identifier.from([f, "devtools" /* PkgName.Devtools */])]),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Network | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes },
        assumePrimitive: false
    },
    {
        type: 'function',
        names: [identifier_1.Identifier.from(['on.exit', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.RegisterHook,
        config: {
            hook: hooks_1.KnownHooks.OnFnExit,
            args: {
                expr: { idx: 0, name: 'expr' },
                add: { idx: 1, name: 'add', default: false },
                after: { idx: 2, name: 'after', default: true },
            }
        },
        assumePrimitive: true
    },
    { type: 'function', names: [identifier_1.Identifier.from(['on_load', "rlang" /* PkgName.Rlang */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.MayPure, sig: [['expr', built_in_props_1.ArgProp.Forced], ['env', built_in_props_1.ArgProp.Value], ['ns', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['on_package_load', "rlang" /* PkgName.Rlang */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.MayPure, sig: [['pkg', built_in_props_1.ArgProp.Value], ['expr', built_in_props_1.ArgProp.Forced], ['env', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['run_on_load', "rlang" /* PkgName.Rlang */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { libFn: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope | built_in_props_1.CallProp.MayPure, sig: [['ns', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    /* `parse(text=)` turns text into an expression, with `file=` it reads that file */
    { type: 'function', names: [identifier_1.Identifier.from(['parse', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Pure }, assumePrimitive: false },
    /* they answer with whatever is on disk when they run */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['list.files', 'dir', 'list.dirs']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.Glob, sig: [['path', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['Sys.glob', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads | built_in_props_1.CallProp.Glob, sig: [['paths', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    /* language objects */
    {
        type: 'function',
        names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['enquote', 'call', 'as.call', 'as.expression', 'as.name', 'as.symbol',
            'as.language', 'match.call', 'sys.call', 'args', 'deparse', 'deparse1']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', props: built_in_props_1.CallProp.Lang },
        assumePrimitive: false
    },
    /* `alist` keeps its arguments unevaluated, `evalq` evaluates its first one in another frame */
    { type: 'function', names: [identifier_1.Identifier.from(['alist', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { props: built_in_props_1.CallProp.Lang, sig: [['...', built_in_props_1.ArgProp.Nse]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['evalq', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { props: built_in_props_1.CallProp.Lang, sig: [['expr', built_in_props_1.ArgProp.Nse], ['envir', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    {
        type: 'function',
        names: identifier_1.Identifier.fromAll("rlang" /* PkgName.Rlang */, ['enexpr', 'enexprs', 'inject', 'enquo', 'enquos', 'enquo0', 'enquos0',
            'ensym', 'ensyms', 'new_formula',
            'f_rhs', 'f_lhs', 'fn_body', 'fn_fmls', 'fn_fmls_names', 'call2', 'sym', 'syms', 'quo_name', 'as_name',
            'as_label', 'as_string']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Lang },
        assumePrimitive: false
    },
    /* native code */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['dyn.load', 'getNativeSymbolInfo']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Ffi }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['sourceCpp', "Rcpp" /* PkgName.Rcpp */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Ffi | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    /* ambient state: options, environment variables, the clock, the session itself */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['getOption', 'Sys.getenv', 'Sys.info', 'Sys.getpid', 'getwd', 'getRversion', 'R.Version', 'Sys.time', 'Sys.Date', 'Sys.timezone', 'date', 'proc.time', 'interactive']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Ambient }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['commandArgs', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Ambient | built_in_props_1.CallProp.CommandLine }, assumePrimitive: false },
    /* system commands */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['system', 'system2', 'shell', 'shell.exec']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Process }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['pipe', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.Opens | built_in_props_1.CallProp.Process, sig: [['description', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['runjs', "shinyjs" /* PkgName.ShinyJs */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Process }, assumePrimitive: false },
    /* whatever the user types, picks, or sends along with a request */
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['readline', 'file.choose']),
            ...identifier_1.Identifier.fromAll("utils" /* PkgName.Utils */, ['askYesNo', 'choose.files', 'choose.dir', 'menu', 'select.list', 'winDialogString', 'winDialog']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', props: built_in_props_1.CallProp.User },
        assumePrimitive: false
    },
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("rstudioapi" /* PkgName.RstudioApi */, ['showPrompt', 'askForPassword', 'selectDirectory', 'selectFile', 'showQuestion']),
            ...identifier_1.Identifier.fromAll("svDialogs" /* PkgName.SvDialogs */, ['dlgInput', 'dlgOpen', 'dlgList', 'dlgSave', 'dlgDir']),
            ...identifier_1.Identifier.fromAll("tcltk" /* PkgName.Tcltk */, ['tk_choose.files', 'tk_choose.dir']),
            ...identifier_1.Identifier.fromAll("shiny" /* PkgName.Shiny */, ['parseQueryString', 'getQueryString', 'getUrlHash', 'restoreInput']),
            ...identifier_1.Identifier.fromAll("shinyFiles" /* PkgName.ShinyFiles */, ['parseFilePaths', 'parseDirPath', 'parseSavePath', 'shinyFileChoose', 'shinyDirChoose', 'shinyFileSave']),
            /* what comes out of a cohort depends on the filters the user set, and on the gui that sets them */
            ...identifier_1.Identifier.fromAll("cohortBuilder" /* PkgName.CohortBuilder */, ['get_data', 'sum_up', 'attrition', 'get_state', 'code', 'stat']),
            ...identifier_1.Identifier.fromAll("shinyCohortBuilder" /* PkgName.ShinyCohortBuilder */, ['cb_server', 'cb_ui', 'cb_chat_server', 'cb_chat_ui', 'gui', 'demo_app']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.User },
        assumePrimitive: false
    },
    /* they only make up a path, they do not go near the file system, so `File` would be wrong here */
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['tempfile', 'tempdir']),
        processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', props: built_in_props_1.CallProp.TempFile }, assumePrimitive: false },
    {
        type: 'function',
        names: [
            ...identifier_1.Identifier.fromAll("fs" /* PkgName.Fs */, ['file_temp', 'dir_temp']),
            ...identifier_1.Identifier.fromAll("withr" /* PkgName.Withr */, ['local_tempfile', 'with_tempfile', 'local_tempdir', 'with_tempdir']),
        ],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.TempFile },
        assumePrimitive: false
    },
    /* wrappers that run the expression they are handed; `observe`/`render*` are left out, they yield a handle instead */
    {
        type: 'function',
        names: identifier_1.Identifier.fromAll("shiny" /* PkgName.Shiny */, ['reactive', 'eventReactive', 'bindEvent', 'bindCache', 'isolate', 'req',
            'debounce', 'throttle', 'reactiveVal', 'reactiveValues', 'reactiveValuesToList', 'freezeReactiveVal']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.MayPure },
        assumePrimitive: false
    },
    /* assembling a cohort keeps the data of its source; `filter` is registered above, dplyr holds that name */
    {
        type: 'function',
        names: identifier_1.Identifier.fromAll("cohortBuilder" /* PkgName.CohortBuilder */, ['cohort', 'set_source', 'add_source', 'update_source', 'add_filter',
            'update_filter', 'rm_filter', 'bind_key', 'bind_keys', 'as.tblist', 'tblist',
            'step', 'add_step', 'rm_step', 'run', 'restore']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { forceArgs: 'all', libFn: true, props: built_in_props_1.CallProp.Pure },
        assumePrimitive: false
    },
    /* they are all mapped to `<-` but we separate super assignments */
    {
        type: 'replacement',
        suffixes: ['<-', '<<-'],
        names: [
            '[', '[[',
            ...identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['names', 'dimnames', 'attributes', 'attr', 'class', 'levels', 'rownames', 'colnames', 'body', 'environment', 'formals', 'length', 'dim']),
        ],
        config: { readIndices: true, props: built_in_props_1.CallProp.Scope }
    },
    {
        type: 'replacement',
        suffixes: ['<-', '<<-'],
        names: [identifier_1.Identifier.from(['method', "S7" /* PkgName.S7 */])],
        config: { readIndices: true, constructName: 's7' }
    },
    {
        type: 'replacement',
        suffixes: ['<-', '<<-'],
        names: ['$', '@'],
        config: { readIndices: false, props: built_in_props_1.CallProp.Scope }
    },
    /* the string and shape functions R declares formals for, restated one by one: the group above gives them
       what they do, this gives them the arguments they do it with (the names are R's own) */
    { type: 'function', names: [identifier_1.Identifier.from(['sprintf', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['fmt', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['format', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: SigXDots }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['grep', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['value', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag], ['invert', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['sub', 'gsub']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['replacement', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['substr', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['start', built_in_props_1.ArgProp.Value], ['stop', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['substring', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['text', built_in_props_1.ArgProp.Value], ['first', built_in_props_1.ArgProp.Value], ['last', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['strsplit', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['split', built_in_props_1.ArgProp.Value], ['fixed', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['trimws', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['which', built_in_props_1.ArgProp.Flag], ['whitespace', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: [identifier_1.Identifier.from(['strtoi', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['base', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['matrix', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['data', built_in_props_1.ArgProp.Value], ['nrow', built_in_props_1.ArgProp.Value], ['ncol', built_in_props_1.ArgProp.Value], ['byrow', built_in_props_1.ArgProp.Flag], ['dimnames', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the tidyverse verbs, under the names R declares them with. They keep the data mask the group above
       gives them; what this adds is which argument is the data and what the further ones are called */
    { type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['mutate', 'transmute', 'select', 'rename']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['filter', "dplyr" /* PkgName.Dplyr */]), identifier_1.Identifier.from(['slice', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.by', built_in_props_1.ArgProp.Value], ['.preserve', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['summarise', 'summarize']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.by', built_in_props_1.ArgProp.Value], ['.groups', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['arrange', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.by_group', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['group_by', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.add', built_in_props_1.ArgProp.Flag], ['.drop', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['distinct', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.keep_all', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['relocate', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [...SigDataDots, ['.before', built_in_props_1.ArgProp.Value], ['.after', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['count', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['wt', built_in_props_1.ArgProp.Value], ['sort', built_in_props_1.ArgProp.Flag], ['name', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['pull', "dplyr" /* PkgName.Dplyr */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['.data', built_in_props_1.ArgProp.Value], ['var', built_in_props_1.ArgProp.Value], ['name', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['nest', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
    /* `drop_na` names its first argument `data`, not `.data`, so it gets a line of its own */
    { type: 'function', names: [identifier_1.Identifier.from(['drop_na', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: [['data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['pivot_longer', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['data', built_in_props_1.ArgProp.Value], ['cols', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['names_to', built_in_props_1.ArgProp.Value], ['values_to', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['pivot_wider', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['names_from', built_in_props_1.ArgProp.Value], ['values_from', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['separate', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['data', built_in_props_1.ArgProp.Value], ['col', built_in_props_1.ArgProp.Value], ['into', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value], ['remove', built_in_props_1.ArgProp.Flag], ['convert', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['unite', "tidyr" /* PkgName.TidyR */])],
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
            sig: [['data', built_in_props_1.ArgProp.Value], ['col', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value], ['remove', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['subset', 'transform']),
        processor: built_in_proc_name_1.BuiltInProcName.Default,
        config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    /* these share the `f(x, ...)` shape above, but R puts one more formal before the `...`: leaving it out
       would shift every position after it, so each names its own */
    { type: 'function', names: [identifier_1.Identifier.from(['sort', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['decreasing', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['unique', 'duplicated']),
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['incomparables', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['as.data.frame', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['row.names', built_in_props_1.ArgProp.Value], ['optional', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['median', "stats" /* PkgName.Stats */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['na.rm', built_in_props_1.ArgProp.Flag], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    /* the ones the earlier list left short where a reader would notice */
    { type: 'function', names: [identifier_1.Identifier.from(['nchar', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Shape], ['type', built_in_props_1.ArgProp.Value], ['allowNA', built_in_props_1.ArgProp.Flag], ['keepNA', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.StringFn },
    { type: 'function', names: [identifier_1.Identifier.from(['grepl', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['pattern', built_in_props_1.ArgProp.Value], ['x', built_in_props_1.ArgProp.Value], ['ignore.case', built_in_props_1.ArgProp.Flag], ['perl', built_in_props_1.ArgProp.Flag], ['fixed', built_in_props_1.ArgProp.Flag], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['match', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure, sig: [['x', built_in_props_1.ArgProp.Value], ['table', built_in_props_1.ArgProp.Value], ['nomatch', built_in_props_1.ArgProp.Value], ['incomparables', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['lengths', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows, sig: [['x', built_in_props_1.ArgProp.Shape], ['use.names', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: true },
    { type: 'function', names: [identifier_1.Identifier.from(['readLines', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.File | built_in_props_1.CallProp.Reads, sig: [['con', built_in_props_1.ArgProp.Resource], ['n', built_in_props_1.ArgProp.Value], ['ok', built_in_props_1.ArgProp.Flag], ['warn', built_in_props_1.ArgProp.Flag], ['encoding', built_in_props_1.ArgProp.Value], ['skipNul', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['writeLines', "base" /* PkgName.Base */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['text', built_in_props_1.ArgProp.Value], ['con', built_in_props_1.ArgProp.Resource], ['sep', built_in_props_1.ArgProp.Value], ['useBytes', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['write.table', "utils" /* PkgName.Utils */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['x', built_in_props_1.ArgProp.Value], ['file', built_in_props_1.ArgProp.Resource], ['append', built_in_props_1.ArgProp.Flag], ['quote', built_in_props_1.ArgProp.Flag], ['sep', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
    { type: 'function', names: [identifier_1.Identifier.from(['download.file', "utils" /* PkgName.Utils */])],
        processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
        config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['url', built_in_props_1.ArgProp.Resource], ['destfile', built_in_props_1.ArgProp.Resource], ['method', built_in_props_1.ArgProp.Value], ['quiet', built_in_props_1.ArgProp.Flag], ['mode', built_in_props_1.ArgProp.Value], ['cacheOK', built_in_props_1.ArgProp.Flag], ['extra', built_in_props_1.ArgProp.Value], ['headers', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
];
/**
 * Contains the built-in definitions recognized by flowR
 */
exports.DefaultBuiltinConfig = markGenerics(exports.WrittenBuiltinDefinitions);
/**
 * Expensive and naive lookup of the default processor for a built-in function name
 */
function getDefaultProcessor(name) {
    if (name.startsWith(unnamed_call_handling_1.UnnamedFunctionCallPrefix)) {
        return built_in_proc_name_1.BuiltInProcName.Unnamed;
    }
    const fn = exports.DefaultBuiltinConfig.find(def => (def.names.some(n => identifier_1.Identifier.getName(n) === name) && def.type !== 'constant')
        || (def.type === 'replacement' && def.suffixes.flatMap(d => def.names.map(n => `${identifier_1.Identifier.getName(n)}${d}`)).includes(name)));
    if (fn?.type === 'replacement') {
        return built_in_proc_name_1.BuiltInProcName.Replacement;
    }
    return fn?.processor === built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs ? built_in_proc_name_1.BuiltInProcName.Default : fn?.processor;
}
//# sourceMappingURL=default-builtin-config.js.map