This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
yada-yada is a term, not an operator
authorLukas Mai <l.mai@web.de>
Thu, 2 Nov 2017 19:48:38 +0000 (19:48 +0000)
committerZefram <zefram@fysh.org>
Thu, 2 Nov 2017 19:48:38 +0000 (19:48 +0000)
t/op/yadayada.t
toke.c

index 861389f..a39b015 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
 
 use strict;
 
-plan 9;
+plan 12;
 
 my $err;
 my $err1 = "Unimplemented at $0 line ";
@@ -42,6 +42,22 @@ eval { @transformed = map {;... } @input; };
 is $@, $err, "Disambiguation case 4";
 $@ = '';
 
+note("RT #132150: ... is a term, not an operator");
+$err = $err1 . ( __LINE__ + 1 ) . $err2;
+eval { ... + 0 };
+is $@, $err, "... + 0 parses";
+$@ = '';
+
+$err = $err1 . ( __LINE__ + 1 ) . $err2;
+eval { ... % 1 };
+is $@, $err, "... % 1 parses";
+$@ = '';
+
+$err = $err1 . ( __LINE__ + 1 ) . $err2;
+eval { ... / 1 };
+is $@, $err, "... / 1 parses";
+$@ = '';
+
 #
 # Regression tests, making sure ... is still parsable as an operator.
 #
diff --git a/toke.c b/toke.c
index bbfb6fb..afcd719 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6853,7 +6853,7 @@ Perl_yylex(pTHX)
        }
        if (PL_expect == XSTATE && s[1] == '.' && s[2] == '.') {
            s += 3;
-           OPERATOR(YADAYADA);
+           TERM(YADAYADA);
        }
        if (PL_expect == XOPERATOR || !isDIGIT(s[1])) {
            char tmp = *s++;