safeguard {sketch} | R 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())
[Package sketch version 1.1.20.3 Index]