diff --git a/R/modspec.R b/R/modspec.R index 8f6d2156..5a72c82b 100644 --- a/R/modspec.R +++ b/R/modspec.R @@ -431,10 +431,6 @@ token_space <- function(x) { } get_c_vars2 <- function(y,context) { - fors <- grep("\\bfor\\s*\\(", y, perl = TRUE) - if(length(fors)) { - y <- y[-fors] - } m <- gregexpr(move_global_re_find,y,perl=TRUE) regm <- unlist(regmatches(y,m)) if(length(regm)==0) return(data.frame()) diff --git a/tests/testthat/test-modspec.R b/tests/testthat/test-modspec.R index a2a200fa..2e1caa59 100644 --- a/tests/testthat/test-modspec.R +++ b/tests/testthat/test-modspec.R @@ -442,12 +442,6 @@ test_that("autodec parsing", { expect_equal(x, "ccc") x <- mrgsolve:::autodec_find("self.foo = 1;") expect_equal(x, character(0)) - # refuse to look at anything on a line with for loop - x <- mrgsolve:::autodec_find("for(int i = 2; i < 5; ++i) { aaa = 3;") - expect_equal(x, character(0)) - # to find it, just put on a new line - x <- mrgsolve:::autodec_find(c("for(int i = 2; i < 5; ++i) {"," aaa = 3;")) - expect_equal(x, "aaa") code <- strsplit(split = "\n", ' double a = 2; b = 3;