| for (j in seq_len(nrow(inserts))) { | for (j in seq_len(nrow(inserts))) { | ||||
| if (inserts$i[j] == 0) next | if (inserts$i[j] == 0) next | ||||
| overlap <- filter( | overlap <- filter( | ||||
| inserts, | |||||
| inserts[1:(j-1), ], | |||||
| i != 0, | i != 0, | ||||
| start <= !!inserts$start[j] & end > !!inserts$end[j]) | |||||
| start <= !!inserts$start[j] & end >= !!inserts$end[j]) | |||||
| inserts[j, 'pad'] <- inserts$pad[j] + nrow(overlap) | inserts[j, 'pad'] <- inserts$pad[j] + nrow(overlap) | ||||
| } | } | ||||
| inserts <- inserts %>% | inserts <- inserts %>% |
|  |  | ||||
| ```r | |||||
| t_nested <- "anestedgroupwithingroupexample" | |||||
| r_nested <- "(a(nested)(group(within(group))(example)))" | |||||
| view_regex(t_nested, r_nested) | |||||
| ``` | |||||
|  | |||||
| ## Planned (ish) | ## Planned (ish) | ||||
|  |  | ||||
| ``` r | |||||
| t_nested <- "anestedgroupwithingroupexample" | |||||
| r_nested <- "(a(nested)(group(within(group))(example)))" | |||||
| view_regex(t_nested, r_nested) | |||||
| ``` | |||||
|  | |||||
| ## Planned (ish) | ## Planned (ish) | ||||
| 1. An Rstudio addin gadget that allows you to interactively enter the | 1. An Rstudio addin gadget that allows you to interactively enter the |