@@ -268,11 +268,9 @@ checkSingleColon <- function(.BiocPackage, avail_pkgs = character(0L)) {
268268 found <- Reduce(`|` , found )
269269 hits <- which(found & tokens [, " token" ] == tokenType )
270270 openBracket <- if (isExp ) " {" else " ("
271- opar <- which(txt == openBracket )
272- startHit <- vapply(hits , function (x ) min(opar [opar > x ]), numeric (1L ))
273- parnum <- tokens [startHit , " parent" ]
274- endHit <- nrow(tokens ) - match(parnum , rev(tokens [, " parent" ]))
275- Map(seq , startHit , endHit )
271+ .getSigRange(
272+ tokens , hits , openBracket
273+ )
276274}
277275
278276.findMinNext <- function (tokens , after , cname = c(" token" , " text" ), cvalue ) {
@@ -284,6 +282,7 @@ checkSingleColon <- function(.BiocPackage, avail_pkgs = character(0L)) {
284282 min()
285283}
286284
285+ # ' @importFrom BiocBaseUtils isScalarNumber
287286.getSigRange <- function (tokens , signalers , bracket ) {
288287 opar <- which(tokens [, " text" ] == bracket )
289288 lapply(
@@ -309,7 +308,10 @@ checkSingleColon <- function(.BiocPackage, avail_pkgs = character(0L)) {
309308 parnum <- tokens [startSig , " parent" ]
310309 endSig <- nrow(tokens ) - match(parnum , rev(tokens [, " parent" ]))
311310 }
312- seq(startSig , endSig )
311+ if (! isScalarNumber(startSig ) || ! isScalarNumber(endSig ))
312+ integer(0L )
313+ else
314+ seq(startSig , endSig )
313315 }
314316 )
315317}
0 commit comments