Skip to content

Roxygen fails to parse commented code that are between single quotes #1694

@ColinFay

Description

@ColinFay

Describe the bug

If I have the following code with single quote and a comment :

#' @import shiny
this <- function() {
  c(
    'this',
    #'this',
    'this',
  )
}

roxygen2::roxygenize() will produce the following NAMESPACE:

# Generated by roxygen2: do not edit by hand

import("this',")
import(shiny)

Expected behavior

The commented code inside the function body is not added to the NAMESPACE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions