-
-
Save zoffixznet/2dde6f364b4f0814a7fc2c150bff9088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2017.08 zoffix@VirtualBox~/CPANPRC/other-rakudo (master)$ gd | |
diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp | |
index b58b684..34d03c8 100644 | |
--- a/src/Perl6/Grammar.nqp | |
+++ b/src/Perl6/Grammar.nqp | |
@@ -61,7 +61,6 @@ role STD { | |
token starter { <!> } | |
token stopper { <!> } | |
- my %quote_lang_cache := nqp::hash(); | |
method quote_lang($l, $start, $stop, @base_tweaks?, @extra_tweaks?) { | |
sub lang_key() { | |
my $stopstr := nqp::istype($stop,VMArray) ?? nqp::join(' ',$stop) !! $stop; | |
@@ -106,10 +105,7 @@ role STD { | |
} | |
# Get language from cache or derive it. | |
- my $key := lang_key(); | |
- my $quote_lang := nqp::existskey(%quote_lang_cache, $key) && $key ne 'NOCACHE' | |
- ?? %quote_lang_cache{$key} | |
- !! (%quote_lang_cache{$key} := con_lang()); | |
+ my $quote_lang := self.quote_lang_cache: lang_key(), { con_lang() }; | |
$quote_lang.set_package(self.package); | |
$quote_lang; | |
} | |
@@ -513,6 +509,13 @@ grammar Perl6::Grammar is HLL::Grammar does STD { | |
$cursor; | |
} | |
+ my %quote_lang_cache := nqp::hash(); | |
+ method quote_lang_cache($key, &prep-lang) { | |
+ nqp::existskey(%quote_lang_cache, $key) && $key ne 'NOCACHE' | |
+ ?? %quote_lang_cache{$key} | |
+ !! (%quote_lang_cache{$key} := prep-lang()); | |
+ } | |
+ | |
## Lexer stuff | |
token apostrophe { | |
2017.08 zoffix@VirtualBox~/CPANPRC/other-rakudo (master)$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment