From 383efe2eb28372b78d763ba5633033f8604e0268 Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Wed, 2 Nov 2016 14:53:08 -0700 Subject: [PATCH 1/3] support for r 3.0.0 --- DESCRIPTION | 4 ++-- src/name.c | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8f9680a..2951390 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: lazyeval -Version: 0.2.0.9000 +Version: 0.2.0.9001 Title: Lazy (Non-Standard) Evaluation Description: An alternative approach to non-standard evaluation using formulas. Provides a full implementation of LISP style 'quasiquotation', @@ -11,7 +11,7 @@ Authors@R: c( License: GPL-3 LazyData: true Depends: - R (>= 3.1.0) + R (>= 3.0.0) Suggests: knitr, rmarkdown (>= 0.2.65), diff --git a/src/name.c b/src/name.c index 0056de8..d471b0e 100644 --- a/src/name.c +++ b/src/name.c @@ -22,12 +22,33 @@ SEXP as_name(SEXP x) { } } +SEXP shallow_duplicate(SEXP list) +{ + if (TYPEOF(list) != LISTSXP) + Rf_errorcall(R_NilValue, "'shallow_duplicate' can only handle LISTSXP objects for now."); + SEXP new = R_NilValue; + SEXP next, a; + /**** Could be done in a single pass */ + /**** Don't need to protect since CONS does */ + for (next = list; next != R_NilValue; next = CDR(next)) + new = Rf_cons(R_NilValue, new); + for (next = list, a = new; + next != R_NilValue; + next = CDR(next), a = CDR(a)) { + SETCAR(a, CAR(next)); + SET_TAG(a, TAG(next)); + /**** ATTRIB?? */ + SET_NAMED(CAR(a), 2); /* may not be necessary */ + } + return new; +} + SEXP lhs_name(SEXP x) { if (TYPEOF(x) != VECSXP) Rf_errorcall(R_NilValue, "`x` must be a list (not a %s)", Rf_type2char(TYPEOF(x))); int n = Rf_length(x); - SEXP x2 = PROTECT(Rf_shallow_duplicate(x)); + SEXP x2 = PROTECT(shallow_duplicate(x)); SEXP names = Rf_getAttrib(x2, R_NamesSymbol); if (names == R_NilValue) { From fc8a7efa3009d528eb56a89651272f2160a4d84e Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Wed, 2 Nov 2016 16:56:01 -0700 Subject: [PATCH 2/3] remove use of shallow_duplicate for suplicate --- src/name.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/name.c b/src/name.c index d471b0e..ad46d18 100644 --- a/src/name.c +++ b/src/name.c @@ -22,33 +22,12 @@ SEXP as_name(SEXP x) { } } -SEXP shallow_duplicate(SEXP list) -{ - if (TYPEOF(list) != LISTSXP) - Rf_errorcall(R_NilValue, "'shallow_duplicate' can only handle LISTSXP objects for now."); - SEXP new = R_NilValue; - SEXP next, a; - /**** Could be done in a single pass */ - /**** Don't need to protect since CONS does */ - for (next = list; next != R_NilValue; next = CDR(next)) - new = Rf_cons(R_NilValue, new); - for (next = list, a = new; - next != R_NilValue; - next = CDR(next), a = CDR(a)) { - SETCAR(a, CAR(next)); - SET_TAG(a, TAG(next)); - /**** ATTRIB?? */ - SET_NAMED(CAR(a), 2); /* may not be necessary */ - } - return new; -} - SEXP lhs_name(SEXP x) { if (TYPEOF(x) != VECSXP) Rf_errorcall(R_NilValue, "`x` must be a list (not a %s)", Rf_type2char(TYPEOF(x))); int n = Rf_length(x); - SEXP x2 = PROTECT(shallow_duplicate(x)); + SEXP x2 = PROTECT(Rf_duplicate(x)); SEXP names = Rf_getAttrib(x2, R_NamesSymbol); if (names == R_NilValue) { From c90aa66f30ca863eae7fab55f6c84b399e0c214e Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Thu, 3 Nov 2016 11:48:16 -0700 Subject: [PATCH 3/3] try .travis.yml feedback --- .travis.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e76cae1..f2c4647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,16 @@ language: r sudo: false cache: packages r: - - oldrel - - release - - devel + - 3.0.3 + - oldrel + - release + - devel + +before_install: + - if [[ "$TRAVIS_R_VERSION_STRING" = '3.0.3' ]]; then git clone https://github.com/hadley/devtools ~/devtools && pushd ~/devtools && git fetch origin pull/1388/head:3.0.3 && git checkout 3.0.3 && R CMD build . && R CMD INSTALL devtools*tar.gz && popd;fi + +install: + - R -e 'devtools::install_deps(dep = T)' after_success: - Rscript -e 'covr::codecov(line_exclusions = c("R/lazy.R", "R/lazy-as.R", "R/lazy-dots.R", "R/lazy-names.R", "R/lazy-call.R", "R/lazy-eval.R", "R/lazy-interp.R", "src/lazy.c"))'