Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: r-lib/roxygen2
Choose a Base Repository
r-lib/roxygen2
1danjordan/roxygen
99701a0554/roxygen
AugustT/roxygen
BarkleyBG/roxygen
DataXujing/roxygen2
DivadNojnarg/roxygen2
DongdongMa/roxygen
Ecosantos/roxygen
Eemaa26/roxygen2
ErmiaAzarkhalili/roxygen
GShotwell/roxygen2
Geoff99/roxygen
IFFranciscoME/roxygen
JoshOBrien/roxygen
LiNk-NY/roxygen
Lucaweihs/roxygen
MaryamGlasgowUni/roxygen2
Przemol/roxygen
QuLogic/roxygen
R-Packages/roxygen
Robinlovelace/roxygen
TAwosanya/roxygen
TomKellyGenetics/roxygen
Tutuchan/roxygen
Wen2012/roxygen
WilDoane/roxygen
YukunZhang/roxygen2
aalfons/roxygen
achubaty/roxygen
al2na/roxygen
apreshill/roxygen
baptiste/roxygen
bastistician/roxygen
batpigandme/roxygen
beckwang80/roxygen2
bestwpw/roxygen
bgctw/roxygen2
billdenney/roxygen2
bquast/roxygen
brettbialer/roxygen
briandk/roxygen
briannafrederick/roxygen
brodieG/roxygen
bryanhanson/roxygen2
caiohamamura/roxygen
cbarbu/roxygen
chaoqing/roxygen2
colinasmith/roxygen
crowding/roxygen
crsh/roxygen
d-sci/roxygen2
dA505819/roxygen2
danielinteractive/roxygen
dbdahl/roxygen
dewittpe/roxygen
dlebauer/roxygen2
dmpe/roxygen
dpritchLibre/roxygen
dragosmg/roxygen2
drmjc/roxygen
e3bo/roxygen2
eddelbuettel/roxygen2
egnha/roxygen
eibanez/roxygen
eliocamp/roxygen2
epicfarmer/roxygen
eribul/roxygen
flying-sheep/roxygen
fmichonneau/roxygen
fxcebx/roxygen
gadenbuie/roxygen2
ghouljd/roxygen
giupo/roxygen
gmbecker/roxygen
gthb/roxygen
gustavdelius/roxygen
gwielinski/roxygen
halldc/roxygen
hhoeflin/roxygen
hjanime/roxygen
huangrh/roxygen2
huashan/roxygen
ibarraespinosa/roxygen2
ijlyttle/roxygen
imanuelcostigan/roxygen
indianvalantine/roxygen
jakob-r/roxygen
jamiefolson/roxygen
jamiepg1/roxygen
jaredlander/roxygen
jayhesselberth/roxygen
jefferis/roxygen
jeis2497052/roxygen
jeroen/roxygen
jhchou/roxygen
jimhester/roxygen
jimvine/roxygen2
jmcimula/roxygen
joey711/roxygen
johnhenrypezzuto/roxygen
jonassundman/roxygen2
jonthegeek/roxygen
josephepowell/roxygen2
jranke/roxygen
jrnold/roxygen
kasaha1/roxygen
kbroman/roxygen
kevinushey/roxygen
klmr/roxygen
kollerma/roxygen2
kornl/roxygen2
krishnapsrinivasan/roxygen2
krlmlr/roxygen2
ktaranov/roxygen
ktkt2009/roxygen2
leeper/roxygen
lindbrook/roxygen
lionel-/roxygen
lukedomanski/roxygen
maelle/roxygen2
malcolmbarrett/roxygen
mamueller/roxygen2
mariytu/roxygen
martin-mfg/roxygen
maurolepore/roxygen2
maxheld83/roxygen
mbsabath/roxygen2
michaelquinn32/roxygen2
mikemc/roxygen
mikmart/roxygen
miraisolutions/roxygen2
mjskay/roxygen
mlindsk/roxygen2
mrustl/roxygen
nbenn/roxygen2
nealrichardson/roxygen2
nemochina2008/roxygen
nfultz/roxygen
nickreich/roxygen2
nteetor/roxygen
openanalytics/roxygen
patricksilva/roxygen
pjoz/roxygen
pkq/roxygen
publicus/roxygen
qlycool/roxygen
rabutler/roxygen
rappster/roxygen
rbarraud/roxygen
renozao/roxygen
rlugojr/roxygen
robinvanemden/roxygen2
rorynolan/roxygen2
rubak/roxygen
russHyde/roxygen2
sachk915/roxygen
sahilseth/roxygen
sba1/roxygen
shabbybanks/roxygen
shrektan/roxygen
soberto/roxygen2
stas-malavin/roxygen2
stevecondylios/roxygen
takluyver/roxygen
tbates/roxygen
thalesmello/roxygen
thierrymoudiki/roxygen2
thomasp85/roxygen
tobiaskley/roxygen
townie/roxygen
tpbilton/roxygen
trinker/roxygen2
vapniks/roxygen
vspinu/roxygen
wakilsarfaraz/roxygen2
wch/roxygen
web-sys1/roxygen2
wenjie2wang/roxygen
wibeasley/roxygen
wligtenberg/roxygen
xtmgah/roxygen
xumaoxuan/roxygen
yihui/roxygen2
yuanjing-ma/roxygen
yutannihilation/roxygen
zoudj/roxygen2
Nothing to show
base: 6f081b75
head repository: r-lib/roxygen2
Choose a Head Repository
r-lib/roxygen2
1danjordan/roxygen
99701a0554/roxygen
AugustT/roxygen
BarkleyBG/roxygen
DataXujing/roxygen2
DivadNojnarg/roxygen2
DongdongMa/roxygen
Ecosantos/roxygen
Eemaa26/roxygen2
ErmiaAzarkhalili/roxygen
GShotwell/roxygen2
Geoff99/roxygen
IFFranciscoME/roxygen
JoshOBrien/roxygen
LiNk-NY/roxygen
Lucaweihs/roxygen
MaryamGlasgowUni/roxygen2
Przemol/roxygen
QuLogic/roxygen
R-Packages/roxygen
Robinlovelace/roxygen
TAwosanya/roxygen
TomKellyGenetics/roxygen
Tutuchan/roxygen
Wen2012/roxygen
WilDoane/roxygen
YukunZhang/roxygen2
aalfons/roxygen
achubaty/roxygen
al2na/roxygen
apreshill/roxygen
baptiste/roxygen
bastistician/roxygen
batpigandme/roxygen
beckwang80/roxygen2
bestwpw/roxygen
bgctw/roxygen2
billdenney/roxygen2
bquast/roxygen
brettbialer/roxygen
briandk/roxygen
briannafrederick/roxygen
brodieG/roxygen
bryanhanson/roxygen2
caiohamamura/roxygen
cbarbu/roxygen
chaoqing/roxygen2
colinasmith/roxygen
crowding/roxygen
crsh/roxygen
d-sci/roxygen2
dA505819/roxygen2
danielinteractive/roxygen
dbdahl/roxygen
dewittpe/roxygen
dlebauer/roxygen2
dmpe/roxygen
dpritchLibre/roxygen
dragosmg/roxygen2
drmjc/roxygen
e3bo/roxygen2
eddelbuettel/roxygen2
egnha/roxygen
eibanez/roxygen
eliocamp/roxygen2
epicfarmer/roxygen
eribul/roxygen
flying-sheep/roxygen
fmichonneau/roxygen
fxcebx/roxygen
gadenbuie/roxygen2
ghouljd/roxygen
giupo/roxygen
gmbecker/roxygen
gthb/roxygen
gustavdelius/roxygen
gwielinski/roxygen
halldc/roxygen
hhoeflin/roxygen
hjanime/roxygen
huangrh/roxygen2
huashan/roxygen
ibarraespinosa/roxygen2
ijlyttle/roxygen
imanuelcostigan/roxygen
indianvalantine/roxygen
jakob-r/roxygen
jamiefolson/roxygen
jamiepg1/roxygen
jaredlander/roxygen
jayhesselberth/roxygen
jefferis/roxygen
jeis2497052/roxygen
jeroen/roxygen
jhchou/roxygen
jimhester/roxygen
jimvine/roxygen2
jmcimula/roxygen
joey711/roxygen
johnhenrypezzuto/roxygen
jonassundman/roxygen2
jonthegeek/roxygen
josephepowell/roxygen2
jranke/roxygen
jrnold/roxygen
kasaha1/roxygen
kbroman/roxygen
kevinushey/roxygen
klmr/roxygen
kollerma/roxygen2
kornl/roxygen2
krishnapsrinivasan/roxygen2
krlmlr/roxygen2
ktaranov/roxygen
ktkt2009/roxygen2
leeper/roxygen
lindbrook/roxygen
lionel-/roxygen
lukedomanski/roxygen
maelle/roxygen2
malcolmbarrett/roxygen
mamueller/roxygen2
mariytu/roxygen
martin-mfg/roxygen
maurolepore/roxygen2
maxheld83/roxygen
mbsabath/roxygen2
michaelquinn32/roxygen2
mikemc/roxygen
mikmart/roxygen
miraisolutions/roxygen2
mjskay/roxygen
mlindsk/roxygen2
mrustl/roxygen
nbenn/roxygen2
nealrichardson/roxygen2
nemochina2008/roxygen
nfultz/roxygen
nickreich/roxygen2
nteetor/roxygen
openanalytics/roxygen
patricksilva/roxygen
pjoz/roxygen
pkq/roxygen
publicus/roxygen
qlycool/roxygen
rabutler/roxygen
rappster/roxygen
rbarraud/roxygen
renozao/roxygen
rlugojr/roxygen
robinvanemden/roxygen2
rorynolan/roxygen2
rubak/roxygen
russHyde/roxygen2
sachk915/roxygen
sahilseth/roxygen
sba1/roxygen
shabbybanks/roxygen
shrektan/roxygen
soberto/roxygen2
stas-malavin/roxygen2
stevecondylios/roxygen
takluyver/roxygen
tbates/roxygen
thalesmello/roxygen
thierrymoudiki/roxygen2
thomasp85/roxygen
tobiaskley/roxygen
townie/roxygen
tpbilton/roxygen
trinker/roxygen2
vapniks/roxygen
vspinu/roxygen
wakilsarfaraz/roxygen2
wch/roxygen
web-sys1/roxygen2
wenjie2wang/roxygen
wibeasley/roxygen
wligtenberg/roxygen
xtmgah/roxygen
xumaoxuan/roxygen
yihui/roxygen2
yuanjing-ma/roxygen
yutannihilation/roxygen
zoudj/roxygen2
Nothing to show
compare: e8e1e22d
  • 9 commits
  • 16 files changed
  • 0 comments
  • 1 contributor
Showing with 207 additions and 226 deletions.
  1. +2 −2 DESCRIPTION
  2. +0 −1 NAMESPACE
  3. +0 −31 R/RcppExports.R
  4. +30 −0 R/cpp11.R
  5. +1 −1 R/rd-usage.R
  6. +0 −1 R/roxygen.R
  7. +9 −9 R/tag-parser.R
  8. +0 −106 src/RcppExports.cpp
  9. +82 −0 src/cpp11.cpp
  10. +3 −3 src/escapeExamples.cpp
  11. +6 −6 src/isComplete.cpp
  12. +6 −7 src/leadingSpaces.cpp
  13. +30 −22 src/parser2.cpp
  14. +5 −4 src/wrapUsage.cpp
  15. +21 −21 tests/testthat/test-tag.R
  16. +12 −12 tests/testthat/test-tokenize.R
@@ -40,7 +40,6 @@ Imports:
pkgload (>= 1.0.2),
purrr (>= 0.3.3),
R6 (>= 2.1.2),
Rcpp (>= 0.11.0),
rlang,
stringi,
stringr (>= 1.0.0),
@@ -54,9 +53,10 @@ Suggests:
R.methodsS3,
R.oo
LinkingTo:
Rcpp
cpp11
VignetteBuilder:
knitr
SystemRequirements: C++11
Encoding: UTF-8
Roxygen: list(markdown = TRUE, load = "installed")
RoxygenNote: 7.1.0
@@ -239,7 +239,6 @@ export(vignette_roclet)
import(rlang)
import(stringr)
importFrom(R6,R6Class)
importFrom(Rcpp,sourceCpp)
importFrom(knitr,knit)
importFrom(knitr,opts_chunk)
importFrom(purrr,keep)

This file was deleted.

@@ -0,0 +1,30 @@
# Generated by cpp11: do not edit by hand

escapeExamples <- function(x) {
.Call("_roxygen2_escapeExamples", x)
}

findEndOfTag <- function(string, is_code) {
.Call("_roxygen2_findEndOfTag", string, is_code)
}

rdComplete <- function(string, is_code) {
.Call("_roxygen2_rdComplete", string, is_code)
}

leadingSpaces <- function(lines) {
.Call("_roxygen2_leadingSpaces", lines)
}

tokenise_block <- function(lines, file, offset) {
.Call("_roxygen2_tokenise_block", lines, file, offset)
}

find_includes <- function(path) {
.Call("_roxygen2_find_includes", path)
}

wrapUsage <- function(string, width, indent) {
.Call("_roxygen2_wrapUsage", string, width, indent)
}

@@ -135,7 +135,7 @@ wrap_usage <- function(name, format_name, formals, suffix = NULL, width = 80L) {
out <- args_call(format_name(name), args)
} else if (roxy_meta_get("old_usage", FALSE)) {
x <- args_call(format_name(name), args)
out <- wrapUsage(x, width = as.integer(width))
out <- wrapUsage(x, width = as.integer(width), indent = 2)
} else {
args <- paste0(" ", args)
args <- map_chr(args, wrapUsage, width = 90, indent = 4)
@@ -9,7 +9,6 @@
#'
#' @useDynLib roxygen2, .registration=TRUE
#' @keywords internal
#' @importFrom Rcpp sourceCpp
#' @importFrom R6 R6Class
#' @importFrom purrr map map_int map_chr map_lgl map2
#' @import rlang
@@ -19,7 +19,7 @@ NULL
tag_value <- function(x) {
if (x$raw == "") {
roxy_tag_warning(x, "requires a value")
} else if (!rdComplete(x$raw)) {
} else if (!rdComplete(x$raw, is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else {
x$val <- str_trim(x$raw)
@@ -32,7 +32,7 @@ tag_value <- function(x) {
tag_inherit <- function(x) {
if (x$raw == "") {
roxy_tag_warning(x, "requires a value")
} else if (!rdComplete(x$raw)) {
} else if (!rdComplete(x$raw, is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else {
pieces <- str_split(str_trim(x$raw), "\\s+")[[1]]
@@ -66,7 +66,7 @@ tag_inherit <- function(x) {
tag_name <- function(x) {
if (x$raw == "") {
roxy_tag_warning(x, "requires a name")
} else if (!rdComplete(x$raw)) {
} else if (!rdComplete(x$raw, is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else if (str_count(x$raw, "\\s+") > 1) {
roxy_tag_warning(x, "should have only a single argument")
@@ -87,7 +87,7 @@ tag_two_part <- function(x, first, second, required = TRUE, markdown = TRUE) {
roxy_tag_warning(x, "requires a value")
} else if (required && !str_detect(x$raw, "[[:space:]]+")) {
roxy_tag_warning(x, "requires ", first, " and ", second)
} else if (!rdComplete(x$raw)) {
} else if (!rdComplete(x$raw, is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else {
pieces <- str_split_fixed(str_trim(x$raw), "[[:space:]]+", 2)
@@ -115,7 +115,7 @@ tag_name_description <- function(x) {
#' @rdname tag_parsers
#' @param min,max Minimum and maximum number of words
tag_words <- function(x, min = 0, max = Inf) {
if (!rdComplete(x$raw)) {
if (!rdComplete(x$raw, is_code = FALSE)) {
return(roxy_tag_warning(x, "mismatched braces or quotes"))
}

@@ -137,7 +137,7 @@ tag_words_line <- function(x) {

if (str_detect(x$val, "\n")) {
roxy_tag_warning(x, "may only span a single line")
} else if (!rdComplete(x$val)) {
} else if (!rdComplete(x$val, is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else {
x$val <- str_split(x$val, "\\s+")[[1]]
@@ -183,7 +183,7 @@ tag_examples <- function(x) {
}

x$val <- escape_examples(gsub("^\n", "", x$raw))
if (!rdComplete(x$val, TRUE)) {
if (!rdComplete(x$val, is_code = TRUE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
} else {
x
@@ -206,7 +206,7 @@ tag_markdown_with_sections <- function(x) {

x$val <- markdown_if_active(x$raw, x, sections = TRUE)
for (i in seq_along(x$val)) {
if (!rdComplete(x$val[i])) {
if (!rdComplete(x$val[i], is_code = FALSE)) {
roxy_tag_warning(x, "mismatched braces or quotes")
x$val[i] <- ""
} else {
@@ -221,7 +221,7 @@ markdown_if_active <- function(text, tag, sections = FALSE) {
if (markdown_on()) {
markdown(text, tag, sections)
} else {
if (!rdComplete(text)) {
if (!rdComplete(text, is_code = FALSE)) {
roxy_tag_warning(tag, "mismatched braces or quotes")
""
} else {

This file was deleted.

@@ -0,0 +1,82 @@
// Generated by cpp11: do not edit by hand


#include "cpp11/declarations.hpp"

// escapeExamples.cpp
std::string escapeExamples(std::string x);
extern "C" SEXP _roxygen2_escapeExamples(SEXP x) {
BEGIN_CPP11
return cpp11::as_sexp(escapeExamples(cpp11::unmove(cpp11::as_cpp<std::string>(x))));
END_CPP11
}
// isComplete.cpp
int findEndOfTag(std::string string, bool is_code);
extern "C" SEXP _roxygen2_findEndOfTag(SEXP string, SEXP is_code) {
BEGIN_CPP11
return cpp11::as_sexp(findEndOfTag(cpp11::unmove(cpp11::as_cpp<std::string>(string)), cpp11::unmove(cpp11::as_cpp<bool>(is_code))));
END_CPP11
}
// isComplete.cpp
bool rdComplete(std::string string, bool is_code);
extern "C" SEXP _roxygen2_rdComplete(SEXP string, SEXP is_code) {
BEGIN_CPP11
return cpp11::as_sexp(rdComplete(cpp11::unmove(cpp11::as_cpp<std::string>(string)), cpp11::unmove(cpp11::as_cpp<bool>(is_code))));
END_CPP11
}
// leadingSpaces.cpp
cpp11::integers leadingSpaces(cpp11::strings lines);
extern "C" SEXP _roxygen2_leadingSpaces(SEXP lines) {
BEGIN_CPP11
return cpp11::as_sexp(leadingSpaces(cpp11::unmove(cpp11::as_cpp<cpp11::strings>(lines))));
END_CPP11
}
// parser2.cpp
cpp11::list tokenise_block(cpp11::strings lines, std::string file, int offset);
extern "C" SEXP _roxygen2_tokenise_block(SEXP lines, SEXP file, SEXP offset) {
BEGIN_CPP11
return cpp11::as_sexp(tokenise_block(cpp11::unmove(cpp11::as_cpp<cpp11::strings>(lines)), cpp11::unmove(cpp11::as_cpp<std::string>(file)), cpp11::unmove(cpp11::as_cpp<int>(offset))));
END_CPP11
}
// parser2.cpp
cpp11::strings find_includes(std::string path);
extern "C" SEXP _roxygen2_find_includes(SEXP path) {
BEGIN_CPP11
return cpp11::as_sexp(find_includes(cpp11::unmove(cpp11::as_cpp<std::string>(path))));
END_CPP11
}
// wrapUsage.cpp
std::string wrapUsage(std::string string, int width, int indent);
extern "C" SEXP _roxygen2_wrapUsage(SEXP string, SEXP width, SEXP indent) {
BEGIN_CPP11
return cpp11::as_sexp(wrapUsage(cpp11::unmove(cpp11::as_cpp<std::string>(string)), cpp11::unmove(cpp11::as_cpp<int>(width)), cpp11::unmove(cpp11::as_cpp<int>(indent))));
END_CPP11
}

extern "C" {
/* .Call calls */
extern SEXP _roxygen2_escapeExamples(SEXP);
extern SEXP _roxygen2_find_includes(SEXP);
extern SEXP _roxygen2_findEndOfTag(SEXP, SEXP);
extern SEXP _roxygen2_leadingSpaces(SEXP);
extern SEXP _roxygen2_rdComplete(SEXP, SEXP);
extern SEXP _roxygen2_tokenise_block(SEXP, SEXP, SEXP);
extern SEXP _roxygen2_wrapUsage(SEXP, SEXP, SEXP);

static const R_CallMethodDef CallEntries[] = {
{"_roxygen2_escapeExamples", (DL_FUNC) &_roxygen2_escapeExamples, 1},
{"_roxygen2_find_includes", (DL_FUNC) &_roxygen2_find_includes, 1},
{"_roxygen2_findEndOfTag", (DL_FUNC) &_roxygen2_findEndOfTag, 2},
{"_roxygen2_leadingSpaces", (DL_FUNC) &_roxygen2_leadingSpaces, 1},
{"_roxygen2_rdComplete", (DL_FUNC) &_roxygen2_rdComplete, 2},
{"_roxygen2_tokenise_block", (DL_FUNC) &_roxygen2_tokenise_block, 3},
{"_roxygen2_wrapUsage", (DL_FUNC) &_roxygen2_wrapUsage, 3},
{NULL, NULL, 0}
};
}

extern "C" void R_init_roxygen2(DllInfo* dll){
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}

@@ -1,7 +1,7 @@
#include <Rcpp.h>
using namespace Rcpp;
#include <cpp11/strings.hpp>
#include <string>

// [[Rcpp::export]]
[[cpp11::register]]
std::string escapeExamples(std::string x) {
std::string out;
out.reserve(x.length() * 1.1);

No commit comments for this range

You can’t perform that action at this time.