14 my $err1 = "Unimplemented at $0 line ";
17 $err = $err1 . ( __LINE__ + 1 ) . $err2;
19 is $@, $err, "Execution of ellipsis statement reported 'Unimplemented' code";
23 is eval { $i++; ...; $i+=10; 123 }, undef;
24 like $@, qr/\AUnimplemented /;
27 note("RT #122661: Semicolon before ellipsis statement disambiguates to indicate block rather than hash reference");
30 $err = $err1 . ( __LINE__ + 1 ) . $err2;
31 eval { @transformed = map {; ... } @input; };
32 is $@, $err, "Disambiguation case 1";
35 $err = $err1 . ( __LINE__ + 1 ) . $err2;
36 eval { @transformed = map {;...} @input; };
37 is $@, $err, "Disambiguation case 2";
40 $err = $err1 . ( __LINE__ + 1 ) . $err2;
41 eval { @transformed = map {; ...} @input; };
42 is $@, $err, "Disambiguation case 3";
45 $err = $err1 . ( __LINE__ + 1 ) . $err2;
46 eval { @transformed = map {;... } @input; };
47 is $@, $err, "Disambiguation case 4";
50 note("RT #132150: ... in other contexts is a syntax error");
54 "... or 1", "1 or ...",
55 "... if 1", "1 if ...",
61 like $@, qr/\Asyntax error /;
65 # Regression tests, making sure ... is still parsable as an operator.
67 my @lines = split /\n/ => <<'--';
69 # Check simple range operator.
70 my @arr = 'A' ... 'D';
72 # Range operator with print.
75 # Without quotes, 'D' could be a file handle.
78 # Another possible interaction with a file handle.
82 foreach my $line (@lines) {
83 next if $line =~ /^\s*#/ || $line !~ /\S/;
84 my $mess = qq {Parsing '...' in "$line" as a range operator};
86 {local *STDOUT; no strict "subs"; $line;}