spin_comments: Spin Comment Check

View source: R/spin.R

spin_commentsR Documentation

Spin Comment Check

Description

A tool to help identify the opening and closing of comments in a spin document. This function is designed to help the user resolve the error "comments must be put in pairs of start and end delimiters."

Usage

spin_comments(hair, comment = c("^[# ]*/[*]", "^.*[*]/ *$"), text = NULL, ...)

Arguments

hair

Path to the R script. The script must be encoded in UTF-8 if it contains multi-byte characters.

comment

A pair of regular expressions for the start and end delimiters of comments; the lines between a start and an end delimiter will be ignored. By default, the delimiters are ⁠/*⁠ at the beginning of a line, and ⁠*/⁠ at the end, following the convention of C-style comments.

text

A character vector of code, as an alternative way to provide the R source. If text is not NULL, hair will be ignored.

...

additional arguments (not currently used.)

Examples


spin_comments(hair = system.file("examples/spinner1.R", package = "qwraps2"))


dewittpe/qwraps2 documentation built on Jan. 4, 2024, 1:59 p.m.