Skip to content

Commit f5727a1

Browse files
maukeZefram
authored and
Zefram
committed
yada-yada is a term, not an operator
1 parent 5a9c3bf commit f5727a1

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

t/op/yadayada.t

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BEGIN {
88

99
use strict;
1010

11-
plan 9;
11+
plan 12;
1212

1313
my $err;
1414
my $err1 = "Unimplemented at $0 line ";
@@ -42,6 +42,22 @@ eval { @transformed = map {;... } @input; };
4242
is $@, $err, "Disambiguation case 4";
4343
$@ = '';
4444

45+
note("RT #132150: ... is a term, not an operator");
46+
$err = $err1 . ( __LINE__ + 1 ) . $err2;
47+
eval { ... + 0 };
48+
is $@, $err, "... + 0 parses";
49+
$@ = '';
50+
51+
$err = $err1 . ( __LINE__ + 1 ) . $err2;
52+
eval { ... % 1 };
53+
is $@, $err, "... % 1 parses";
54+
$@ = '';
55+
56+
$err = $err1 . ( __LINE__ + 1 ) . $err2;
57+
eval { ... / 1 };
58+
is $@, $err, "... / 1 parses";
59+
$@ = '';
60+
4561
#
4662
# Regression tests, making sure ... is still parsable as an operator.
4763
#

toke.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6853,7 +6853,7 @@ Perl_yylex(pTHX)
68536853
}
68546854
if (PL_expect == XSTATE && s[1] == '.' && s[2] == '.') {
68556855
s += 3;
6856-
OPERATOR(YADAYADA);
6856+
TERM(YADAYADA);
68576857
}
68586858
if (PL_expect == XOPERATOR || !isDIGIT(s[1])) {
68596859
char tmp = *s++;

0 commit comments

Comments
 (0)