make_rule: Make a AST transformation rule

Description Usage Arguments Value Examples

View source: R/core-rewrite.R

Description

Make a AST transformation rule

Usage

1
make_rule(from, to)

Arguments

from

A character string.

to

A character string.

Value

A function that takes a language object and returns a language object.

Examples

1
2
3
4
5
library(rockstaR)

rule = make_rule("nothing", "NULL")
lyrics = "Rockstar is nothing"
rewrite(lyrics, list(rule))

trianglegirl/rockstaR documentation built on Dec. 31, 2020, 8:46 a.m.