This function takes R code as string and creates the corresponding abstract syntax tree (AST) from which we can query nodes.
Arguments
- txt
A character string of length 1 containing the code to parse. If provided,
filemust not be provided.- file
Path to file containing the code to parse. If provided,
txtmust not be provided.Character vector indicating the tags to ignore. Default is
"ast-grep-ignore", meaning that any line that follows# ast-grep-ignorewill be ignored in the output ofnode_*()functions.