R/extendr-wrappers.R

Defines functions commit_edits replace prev_all prev next_all next_ children ancestors child parent field find_all find get_root get_transformed get_multiple_matches get_match follows precedes has inside matches text kind is_named_leaf is_named is_leaf range filename root new

# Generated by extendr: Do not edit by hand

# nolint start

#
# This file was created with the following call:
#   .Call("wrap__make_astgrepr_wrappers", use_symbols = TRUE, package_name = "astgrepr")

#' @usage NULL
#' @useDynLib astgrepr, .registration = TRUE
NULL

SgRoot <- new.env(parent = emptyenv())

SgRoot$new <- function(src) .Call(wrap__SgRoot__new, src)

SgRoot$root <- function() .Call(wrap__SgRoot__root, self)

SgRoot$filename <- function() .Call(wrap__SgRoot__filename, self)

#' @export
`$.SgRoot` <- function (self, name) { func <- SgRoot[[name]]; environment(func) <- environment(); func }

#' @export
`[[.SgRoot` <- `$.SgRoot`

SgNode <- new.env(parent = emptyenv())

SgNode$range <- function() .Call(wrap__SgNode__range, self)

SgNode$is_leaf <- function() .Call(wrap__SgNode__is_leaf, self)

SgNode$is_named <- function() .Call(wrap__SgNode__is_named, self)

SgNode$is_named_leaf <- function() .Call(wrap__SgNode__is_named_leaf, self)

SgNode$kind <- function() .Call(wrap__SgNode__kind, self)

SgNode$text <- function() .Call(wrap__SgNode__text, self)

SgNode$matches <- function(rule) .Call(wrap__SgNode__matches, self, rule)

SgNode$inside <- function(rule) .Call(wrap__SgNode__inside, self, rule)

SgNode$has <- function(rule) .Call(wrap__SgNode__has, self, rule)

SgNode$precedes <- function(rule) .Call(wrap__SgNode__precedes, self, rule)

SgNode$follows <- function(rule) .Call(wrap__SgNode__follows, self, rule)

SgNode$get_match <- function(meta_var) .Call(wrap__SgNode__get_match, self, meta_var)

SgNode$get_multiple_matches <- function(meta_var) .Call(wrap__SgNode__get_multiple_matches, self, meta_var)

SgNode$get_transformed <- function(meta_var) .Call(wrap__SgNode__get_transformed, self, meta_var)

SgNode$get_root <- function() .Call(wrap__SgNode__get_root, self)

SgNode$find <- function(rule) .Call(wrap__SgNode__find, self, rule)

SgNode$find_all <- function(rule) .Call(wrap__SgNode__find_all, self, rule)

SgNode$field <- function(name) .Call(wrap__SgNode__field, self, name)

SgNode$parent <- function() .Call(wrap__SgNode__parent, self)

SgNode$child <- function(nth) .Call(wrap__SgNode__child, self, nth)

SgNode$ancestors <- function() .Call(wrap__SgNode__ancestors, self)

SgNode$children <- function() .Call(wrap__SgNode__children, self)

SgNode$next_ <- function() .Call(wrap__SgNode__next_, self)

SgNode$next_all <- function() .Call(wrap__SgNode__next_all, self)

SgNode$prev <- function() .Call(wrap__SgNode__prev, self)

SgNode$prev_all <- function() .Call(wrap__SgNode__prev_all, self)

SgNode$replace <- function(text) .Call(wrap__SgNode__replace, self, text)

SgNode$commit_edits <- function(edits) .Call(wrap__SgNode__commit_edits, self, edits)

#' @export
`$.SgNode` <- function (self, name) { func <- SgNode[[name]]; environment(func) <- environment(); func }

#' @export
`[[.SgNode` <- `$.SgNode`


# nolint end

Try the astgrepr package in your browser

Any scripts or data that you put into this service are public.

astgrepr documentation built on June 8, 2025, 11:05 a.m.