Package: astgrepr 0.0.6

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.0.6.tar.gz
astgrepr_0.0.6.zip(r-4.5)astgrepr_0.0.6.zip(r-4.4)astgrepr_0.0.6.zip(r-4.3)
astgrepr_0.0.6.tgz(r-4.4-x86_64)astgrepr_0.0.6.tgz(r-4.4-arm64)astgrepr_0.0.6.tgz(r-4.3-arm64)
astgrepr_0.0.6.tar.gz(r-4.5-noble)astgrepr_0.0.6.tar.gz(r-4.4-noble)
astgrepr.pdf |astgrepr.html
astgrepr/json (API)
NEWS

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

Peer review:

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

On CRAN:

35 exports 16 stars 2.18 score 4 dependencies 1 dependents 4 scripts

Last updated 16 hours agofrom:1a7c203cdc. Checks:OK: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 07 2024
R-4.5-win-x86_64OKSep 07 2024
R-4.5-linux-x86_64OKSep 07 2024
R-4.4-win-x86_64OKSep 07 2024
R-4.4-mac-x86_64OKSep 07 2024
R-4.4-mac-aarch64OKSep 07 2024
R-4.3-win-x86_64OKSep 07 2024
R-4.3-mac-aarch64OKSep 07 2024

Exports:ast_ruleexpect_snapshotnode_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 Sep 07 2024.

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