@@ -197,7 +197,7 @@ parse_r_files = function(dir, is_base) {
197
197
return (out )
198
198
}
199
199
names(out ) = r_files
200
- return ( out )
200
+ out
201
201
}
202
202
203
203
# inspired by the --keyword argument in gettext, but customized to make sense for R.
@@ -463,32 +463,32 @@ drop_suppressed_and_named = function(calls_data, expr_data, target_args) {
463
463
build_call = function (lines , comments , params ) {
464
464
if (params $ line1 == params $ line2 ) {
465
465
return (substr(adjust_tabs(lines [params $ line1 ]), params $ col1 , params $ col2 ))
466
- } else {
467
- lines = lines [params $ line1 : params $ line2 ]
468
-
469
- # substring not substr here so we can eschew providing
470
- # last=nchar(lines[1L]) because we'd need to recalculate it after adjust_tabs()
471
- lines [1L ] = substring(adjust_tabs(lines [1L ]), params $ col1 )
472
- lines [length(lines )] = substring(adjust_tabs(lines [length(lines )]), 1L , params $ col2 )
473
-
474
- # strip comments, _after_ getting the tab-adjusted column #s
475
- for (ii in seq_len(nrow(comments ))) {
476
- # we've already subset lines, so line numbers have to be re-mapped
477
- adj_line_idx = comments $ line1 [ii ] - params $ line1 + 1L
478
- # column number has to be re-mapped relative to col1 as well, but only on line1 itself
479
- col_adj = if (adj_line_idx == 1L ) params $ col1 else 1L
480
- lines [adj_line_idx ] = substr(
481
- lines [adj_line_idx ],
482
- 1L ,
483
- comments $ col1 [ii ] - col_adj
484
- )
485
- }
466
+ }
486
467
487
- # strip internal whitespace across lines in the call
488
- # NB: eventually, this will need to be smarter about multi-line STR_CONST...
489
- # for now, just wave hands around those....
490
- return (paste(trimws(lines ), collapse = " " ))
468
+ lines = lines [params $ line1 : params $ line2 ]
469
+
470
+ # substring not substr here so we can eschew providing
471
+ # last=nchar(lines[1L]) because we'd need to recalculate it after adjust_tabs()
472
+ lines [1L ] = substring(adjust_tabs(lines [1L ]), params $ col1 )
473
+ lines [length(lines )] = substring(adjust_tabs(lines [length(lines )]), 1L , params $ col2 )
474
+
475
+ # strip comments, _after_ getting the tab-adjusted column #s
476
+ for (ii in seq_len(nrow(comments ))) {
477
+ # we've already subset lines, so line numbers have to be re-mapped
478
+ adj_line_idx = comments $ line1 [ii ] - params $ line1 + 1L
479
+ # column number has to be re-mapped relative to col1 as well, but only on line1 itself
480
+ col_adj = if (adj_line_idx == 1L ) params $ col1 else 1L
481
+ lines [adj_line_idx ] = substr(
482
+ lines [adj_line_idx ],
483
+ 1L ,
484
+ comments $ col1 [ii ] - col_adj
485
+ )
491
486
}
487
+
488
+ # strip internal whitespace across lines in the call
489
+ # NB: eventually, this will need to be smarter about multi-line STR_CONST...
490
+ # for now, just wave hands around those....
491
+ paste(trimws(lines ), collapse = " " )
492
492
}
493
493
494
494
adjust_tabs = function (l ) {
@@ -526,7 +526,7 @@ clean_text = function(x) {
526
526
# e.g. in 'a string with an \"escaped\" quote', the escapes for " disappear after parsing. See #128
527
527
x = gsub(" (?:^|(?<![\\\\ ]))[\\\\ ](['\" ])" , " \\ 1" , x , perl = TRUE )
528
528
x = gsub(' \\\\ ' , ' \\ ' , x , fixed = TRUE )
529
- return ( x )
529
+ x
530
530
}
531
531
532
532
string_schema = function () {
0 commit comments