Giter Club home page Giter Club logo

Comments (3)

hadley avatar hadley commented on July 30, 2024

Does that cause any problems for you? If it should be quoted, R CMD check should be warning about it.

from roxygen2.

yihui avatar yihui commented on July 30, 2024

I mean it should NOT be quoted, but currently roxygen2 does quote it.

library(roxygen2)
roc <- rd_roclet()
out <- roc_proc_text(roc, "
    #' @name a
    #' @aliases \\%a\\%
    NULL")[[1]]
roxygen2:::get_tag(out, 'alias')$values

The output is:

> roxygen2:::get_tag(out, 'alias')$values
[1] "a"           "\"\\%a\\%\""

from roxygen2.

unDocUMeantIt avatar unDocUMeantIt commented on July 30, 2024

here's a fix, in two patches:

patch1

--- roclet-namespace.R.orig     2011-08-29 23:52:59.648650390 +0200
+++ roclet-namespace.R  2011-09-01 19:25:54.228446954 +0200
@@ -182,9 +182,15 @@
   unlist(lapply(matches, f, tag = tag, all = partitum), use.names = FALSE)
 }

-words <- function(x) {
-  quote_if_needed(str_split(str_trim(x), "\\s+")[[1]])
+words <- function(x, quote=TRUE) {
+  x.trimmed <- str_split(str_trim(x), "\\s+")[[1]]
+  if(isTRUE(quote)){
+    return(quote_if_needed(x.trimmed))
+  } else {
+    return(x.trimmed)
+  }
 }
+
 is.syntactic <- function(x) make.names(x) == x
 has.quotes <- function(x) str_detect(x, "'|\"")
 quote_if_needed <- function(x) {

patch2

--- roclet-rd.R.orig    2011-07-28 20:59:24.000000000 +0200
+++ roclet-rd.R 2011-09-01 19:27:26.976672899 +0200
@@ -333,7 +333,7 @@
   add_tag(rd, process_description(partitum, base_path))

   add_tag(rd, process_had_tag(partitum, 'aliases', function(tag, param) {
-      new_tag('alias', words(param))
+      new_tag('alias', words(param, quote=FALSE))
     }))
   add_tag(rd, process.usage(partitum))
   add_tag(rd, process.arguments(partitum))

from roxygen2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.