File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed
Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Roxygen: list(markdown = TRUE)
1313RoxygenNote: 7.3.2
1414Imports:
1515 dplyr,
16- parcr,
16+ parcr (>= 0.5.3) ,
1717 stats,
1818 stringr
1919Suggests:
Original file line number Diff line number Diff line change @@ -104,29 +104,15 @@ Header <- function() {
104104# ' @param line A character string representing a line from the datasheet.
105105# ' @return A parsed comment as a string or an empty list if parsing fails.
106106# ' @noRd
107- parse_comment <- function (line ) {
108- m <- stringr :: str_match(line , comment_pattern )
109- if (is.na(m [1 ])) {
110- return (list ()) # signal failure
111- } else {
112- return (m [2 ])
113- }
114- }
107+ parse_comment <- stringparser(comment_pattern )
115108
116109# ' Parse a Header Line
117110# '
118111# ' Parses a header line based on the `header_pattern`.
119112# ' @param line A character string representing a line from the datasheet.
120113# ' @return A parsed header as a string or an empty list if parsing fails.
121114# ' @noRd
122- parse_header <- function (line ) {
123- m <- stringr :: str_match(line , header_pattern )
124- if (is.na(m [1 ])) {
125- return (list ()) # signal failure
126- } else {
127- return (stringr :: str_trim(m [2 ], side = " both" ))
128- }
129- }
115+ parse_header <- stringparser(header_pattern , function (x ) {stringr :: str_trim(x [1 ], side = " both" )})
130116
131117# ' Parse a Tab-Separated Line
132118# '
You can’t perform that action at this time.
0 commit comments