Package: astgrepr 0.1.1

astgrepr: Parse and Manipulate R Code

Parsing R code is key to build tools such as linters and stylers. This package provides a binding to the 'Rust' crate 'ast-grep' so that one can parse and explore R code.

Authors:Etienne Bacher [aut, cre, cph]

astgrepr_0.1.1.tar.gz
astgrepr_0.1.1.zip(r-4.7)astgrepr_0.1.1.zip(r-4.6)astgrepr_0.1.1.zip(r-4.5)
astgrepr_0.1.1.tgz(r-4.6-x86_64)astgrepr_0.1.1.tgz(r-4.6-arm64)astgrepr_0.1.1.tgz(r-4.5-x86_64)astgrepr_0.1.1.tgz(r-4.5-arm64)
astgrepr_0.1.1.tar.gz(r-4.7-arm64)astgrepr_0.1.1.tar.gz(r-4.7-x86_64)astgrepr_0.1.1.tar.gz(r-4.6-arm64)astgrepr_0.1.1.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html
card.svg |card.png
astgrepr/json (API)
NEWS

# Install 'astgrepr' in R:
install.packages('astgrepr', repos = c('https://etiennebacher.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/etiennebacher/astgrepr/issues

Pkgdown/docs site:https://astgrepr.etiennebacher.com

On CRAN:

Conda:

rustcargo

6.60 score 33 stars 1 packages 10 scripts 482 downloads 34 exports 4 dependencies

Last updated from:41d20ade42. Checks:10 OK, 2 WARNING, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK193
linux-devel-x86_64OK177
source / vignettesOK277
linux-release-arm64OK184
linux-release-x86_64OK176
macos-release-arm64WARNING191
macos-release-x86_64WARNING283
macos-oldrel-arm64OK146
macos-oldrel-x86_64OK299
windows-develOK207
windows-releaseOK210
windows-oldrelOK280
wasm-releaseFAIL154

Exports:ast_rulenode_ancestorsnode_childnode_childrennode_findnode_find_allnode_followsnode_get_matchnode_get_multiple_matchesnode_get_rootnode_hasnode_insidenode_is_leafnode_is_namednode_is_named_leafnode_kindnode_matchesnode_nextnode_next_allnode_parentnode_precedesnode_prevnode_prev_allnode_rangenode_range_allnode_replacenode_replace_allnode_textnode_text_allpattern_rulerelational_ruletree_newtree_rewritetree_root

Dependencies:backportscheckmaterrapplyyaml

Getting started

Rendered fromastgrepr.Rmdusingknitr::rmarkdownon May 22 2026.

Last update: 2024-06-28
Started: 2024-06-27

Readme and manuals

Help Manual

Help pageTopics
Build a ruleast_rule
Recover the tree root from a nodenode_get_root
Find the kind of a nodenode_kind
Find node(s) matching a patternnode-find node_find node_find_all
Change the code in the treenode-fix node_replace node_replace_all
Get the match(es) from a meta-variablenode-get-match node_get_match node_get_multiple_matches
Get more precise information on a nodenode-info node_follows node_has node_inside node_matches node_precedes
Get information on nodesnode-is node_is_leaf node_is_named node_is_named_leaf
Get the start and end positions of a nodenode-range node_range node_range_all
Extract the code corresponding to one or several nodesnode-text node_text node_text_all
Navigate the treenode-traversal node_ancestors node_child node_children node_next node_next_all node_parent node_prev node_prev_all
Build a pattern rulepattern_rule
Build a relational rulerelational_rule
Create a syntax treetree_new
Rewrite the tree with a list of replacementstree_rewrite
Get the root of the syntax treetree_root