walk_tree: Walk Along a Parse Tree

View source: R/walk_tree.R

walk_treeR Documentation

Walk Along a Parse Tree

Description

Walk Along a Parse Tree

Usage

walk_tree(
  x,
  path = "",
  depth = 0L,
  max_depth = 20L,
  dbg = TRUE,
  config = list(),
  context = NULL
)

Arguments

x

parse tree as returned by parse or a sub-tree of the parse tree

path

for internal use only. Path to the element in the parse tree.

depth

for internal use only. Recursion depth.

max_depth

maximum recursion level. Default: 20L

dbg

whether or not to show debug messages

config

list defining modifications of nodes in the node tree. TODO: describe further

context

if not NULL (the default) this is expected to be a list containing additional data. Currently list element "file" is used to pass the name of the script that the current tree was read from.

Examples

walk_tree(parse(text = "x <- 1:n"))

KWB-R/kwb.code documentation built on July 28, 2023, 5:57 p.m.