Skip to content

Commit 74a54ef

Browse files
slightly simplify (?) regex
1 parent 5878084 commit 74a54ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/data.table.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ replace_dot_alias = function(e) {
267267
jsub = replace_dot_alias(jsub)
268268
root = root_name(jsub)
269269
# exclude '..1' etc. for #5460
270-
av = grepv("^[.][.](?:[.]|[0-9]+)$", all.vars(jsub), invert=TRUE)
270+
av = grepv("^[.][.][.0-9][0-9]*$", all.vars(jsub), invert=TRUE)
271271
all..names = FALSE
272272
if ((.is_withFALSE_range(jsub, x, root, av)) ||
273273
(root %chin% c("-","!") && jsub[[2L]] %iscall% '(' && jsub[[2L]][[2L]] %iscall% ':') || ## x[, !(V8:V10)]
@@ -1300,7 +1300,7 @@ replace_dot_alias = function(e) {
13001300

13011301
syms = all.vars(jsub)
13021302
syms = syms[startsWith(syms, "..")]
1303-
syms = grepv("^[.][.](?:[.]|[0-9]+)$", syms, invert=TRUE) # exclude ellipsis and '..n' ellipsis elements
1303+
syms = grepv("^[.][.][.0-9][0-9]*$", syms, invert=TRUE) # exclude ellipsis and '..n' ellipsis elements
13041304
for (sym in syms) {
13051305
if (sym %chin% names_x) {
13061306
# if "..x" exists as column name, use column, for backwards compatibility; e.g. package socialmixr in rev dep checks #2779

0 commit comments

Comments
 (0)