Skip to content
Permalink
Browse files

Make .obs/.obsvar/.sorryobs/.worryobs work better

Before they were apparently returning 1 if they didn't throw, which caused
the NQP regex engine to go berserk.

Fixes R#2556.
  • Loading branch information...
lizmat committed Dec 28, 2018
1 parent df748ea commit af868f8470e09ff4ff832fa0469b7248c5b2487f
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Perl6/Grammar.nqp
@@ -368,12 +368,14 @@ role STD {
when => $when,
);
}
self;
}
method obsvar($name, $identifier-name?) {
unless $*LANG.pragma('p5isms') {
$*W.throw(self.MATCH(), ['X', 'Syntax', 'Perl5Var'],
:$name, :$identifier-name);
}
self;
}
method sorryobs($old, $new, $when = 'in Perl 6') {
unless $*LANG.pragma('p5isms') {
@@ -383,6 +385,7 @@ role STD {
when => $when,
);
}
self;
}
method worryobs($old, $new, $when = 'in Perl 6') {
unless $*LANG.pragma('p5isms') {
@@ -392,6 +395,7 @@ role STD {
when => $when,
);
}
self;
}
method dupprefix($prefixes) {

0 comments on commit af868f8

Please sign in to comment.
You can’t perform that action at this time.