safeguard: Perform pre-transpilation check

View source: R/extra-check.R

safeguardR Documentation

Perform pre-transpilation check

Description

Perform pre-transpilation check

Usage

safeguard(ast, rules, deparsers)

Arguments

ast

A language object.

rules

A list of functions; the rewriting rules, each of which is the output from make_rule.

deparsers

A list of functions; the deparsers, each of which is the output from make_deparser.

Value

TRUE when the check is complete.

Examples

# Expect no warning
safeguard(parse_expr("a <- 3"),
          rules = default_rules(),
          deparsers = default_deparsers())

# Expect a warning (as `max` is reserved to be a function by the transpiler)
safeguard(parse_expr("max <- 3"),
          rules = default_rules(),
          deparsers = default_deparsers())


sketch documentation built on Oct. 23, 2022, 5:07 p.m.