-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
76 lines (74 loc) · 1.56 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
devtools::document()
devtools::check()
q()
$n
n
library(treesitter)
setwd('/home/john/Opifex/BMS/Packages/blockr.export/')
language <- treesitter.r::language()
parser <- parser(language = language)
text <- "foo <- function(x){return(x + )}"
text <- "foo <- function(x){return(x + 2)}"
parser_parse(parse, text = text)
parser_parse(parser, text = text)
parser_parse(parser, text = text) -> x
str(x)
x[[1]]
x[[2]]
x$language
attributes(x)
print.tree_sitter_tree
print(x)
tree_root_node
tree_root_node(x)
tree_root_node(x) |> node_child1
tree_root_node(x) |> node_child(1)
tree_root_node(x) |> node_child(1) |> node_text()
q(90)
q
q()
n
blockr::available_blocks()
library(treesitter)
language <- treesitter.r::language()
parser <- parser(language)
text <- "data |> dplyr::mutate(x > 1)"
parser_parse(parser, text)
parser_parse(parser, text) -> tree
treesitter::node_child_by_field_name
?treesitter::node_child_by_field_name
?treesitter::node_walk
w <- tree |> node_walk()
w <- tree |> node_root() |> node_walk()
w <- tree |> tree_root_node() |> node_walk()
w$goto_next_sibling()
w$field_name
w$field_name()
w$node()
w$goto_next_sibling()
w$node()
w$
$g
i
w$goto_first_child()
w$node()
w$goto_next_sibling()
w$goto_first_child()
w$goto_next_sibling()
w$node()
w$text()
w$field_name()
stringr::str_extract("data |> dplyr::mutate(x = 1)", "\b\w+(?=::)")
stringr::str_extract("data |> dplyr::mutate(x = 1)", "\\b\\w+(?=::)")
stringr::str_extract("data |> dplyr::mutate(x = 1)", "\\b\\w+(?=::)"))
available.packages()
q()
n
:q
q()
n
devtools::document()
devtools::check()
devtools::check()
q()
n