Skip to main content

compile_exprs

compile_exprsR Documentation

Compile R code into JavaScript code#

Description#

Compile R code into JavaScript code

Usage#

compile_exprs(x, rules = default_rules(), deparsers = default_deparsers())

Arguments#

xA character string; the expression to transpile to JS.
rulesA list of rewriting rules. See make_rule for more detail.
deparsersA list of deparsers. See make_deparser for more detail.

Value#

A character string.

Examples#

compile_exprs("R + Cpp", list(make_rule('Cpp', 'JS')))
compile_exprs("math.add(a, b)", list(make_rule('math.add', '+')))