knitr::opts_chunk$set(echo = TRUE)
library(straw)
# comma
expr <- "x[1,]"
# dots
expr <- "function(a = 1, ...) 2"
# literal a in in $ statement
expr <- "d$a"
# TOFIX: need to detect EQ_ASSIGN tokens
#        will this be expensive w/o context?

# note occurs when using "=" instead of "<-"
# treats it more like function signature...
# (occurs even with multiple statements)
a = 2

# even worse (compare to a <- b <- 3)
a = b = 3

parse(text = "a = b = 3") %>%
  create_parse_graph(type = "ast") %>%
  tbl_to_cyto() %>%
  cytoscape_dagre()


machow/straw documentation built on Sept. 9, 2020, 12:40 a.m.