Skip to content

Commit

Permalink
Fix quote lang cache regression
Browse files Browse the repository at this point in the history
Fixes RT#132262: https://rt.perl.org/Ticket/Display.html?id=132262

After the Big Slang Refactor, the quote lang cache started to fail
to notice when the cached lang was mutated (e.g. by defining
a new prefix op). This caused failure to parse new ops, such
as behaviour in the ticket, since the new quoted block still used the
old pre-op-mixin lang.

Fix by adding the name of the lang object to key the cache on.
  • Loading branch information
zoffixznet committed Oct 28, 2017
1 parent 322dcc9 commit ad16c6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -65,7 +65,9 @@ role STD {
method quote_lang($l, $start, $stop, @base_tweaks?, @extra_tweaks?) {
sub lang_key() {
my $stopstr := nqp::istype($stop,VMArray) ?? nqp::join(' ',$stop) !! $stop;
my @keybits := [$l.HOW.name($l), $start, $stopstr];
my @keybits := [
self.HOW.name(self), $l.HOW.name($l), $start, $stopstr
];
for @base_tweaks {
@keybits.push($_);
}
Expand Down

0 comments on commit ad16c6f

Please sign in to comment.