Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davisvaughan/trees
What the Package Does (One Line, Title Case)
https://github.com/davisvaughan/trees
Last synced: 7 days ago
JSON representation
What the Package Does (One Line, Title Case)
- Host: GitHub
- URL: https://github.com/davisvaughan/trees
- Owner: DavisVaughan
- License: other
- Created: 2023-12-29T01:13:17.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-05T18:18:40.000Z (9 months ago)
- Last Synced: 2024-10-09T22:09:59.315Z (28 days ago)
- Language: C
- Size: 1.48 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# trees
The goal of trees is to ...
## Installation
You can install the development version of trees like so:
``` r
pak::pak("DavisVaughan/trees")
```## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(trees)language <- language_r()
language$node_kind_for_id(3L)parser <- Parser$new(language)
tree <- parser$parse("x + 1")node <- tree$root_node()
nodenode |>
node_child(0) |>
node_children()
``````{r cars}
language <- language_from_github("tree-sitter/tree-sitter-python", branch = "master")
language$node_kind_for_id(3L)parser <- Parser$new(language)
tree <- parser$parse("x + 1")node_as_text(tree$root_node())
```