Description Usage Arguments Value Examples
Produce an ast or parse graph of an expression
1 | match_expr(g_parse, g_ast, parse_node, ast_node)
|
g_parse |
Parse graph generated by create_parse_graph |
g_ast |
AST graph generated by create_parse_graph |
parse_node |
node from g_parse to search from |
ast_node |
node from g_ast to search from |
A data.frame linking the graphs with columns parse_id, ast_id
1 2 3 4 5 6 7 8 | exp <- parse(text = "if (x) 2 else a$'b'")
g <- create_parse_graph(parse(text = "if (x) 2 else a$'b'"))
plot(g, layout = layout.reingold.tilford)
g_ast <- create_parse_graph(exp, type = "ast")
plot(g_ast, layout = layout.reingold.tilford)
match_expr(g, g_ast, g[2,], g_ast[2,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.