Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add canary to signal grammar changing in setting
  • Loading branch information
lizmat committed Oct 8, 2015
1 parent f931261 commit b9c7b4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Perl6/Grammar.nqp
Expand Up @@ -4469,6 +4469,14 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
my @parts := nqp::split(' ', $opname);

# The settings should only have 1 grammar, otherwise it will slow down
# loading of rakudo significantly on *every* run. This is a canary that
# will let itself be known should someone make changes to the setting that
# would cause a grammar change, and thus a slowdown.
if $*COMPILING_CORE_SETTING {
self.panic("don't change grammar in the setting, please!");
}

if $is_term {
my role Term[$meth_name, $op] {
token ::($meth_name) { $<sym>=[$op] }
Expand Down

0 comments on commit b9c7b4f

Please sign in to comment.