Skip to content
Permalink
Browse files

Generalize "use isms" handling, add 'use isms <C++>'

Also allow "use isms" to (de-)activate all known isms.  This does
*not* yet actually de-activate the "new Foo" logic: this appears to
be a bit more troublesome.
  • Loading branch information...
lizmat committed Sep 11, 2018
1 parent f5ebad9 commit 57f89278e97278e665619b5e09e7780f2968c031
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/Perl6/World.nqp
@@ -969,6 +969,11 @@ class Perl6::World is HLL::World {
'parameters', 1,
);

my %isms := nqp::hash(
'Perl5', 'p5isms',
'C++', 'c++isms',
);

method do_pragma($/,$name,$on,$arglist) {

my $RMD := self.RAKUDO_MODULE_DEBUG;
@@ -1087,8 +1092,8 @@ class Perl6::World is HLL::World {
if nqp::islist($arglist) {
my @huh;
for $arglist -> $ism {
if $ism eq 'Perl5' {
$*LANG.set_pragma('p5isms', $on);
if nqp::atkey(%isms,$ism) -> $value {
$*LANG.set_pragma($value, $on);
}
else {
nqp::push(@huh,$ism)
@@ -1102,6 +1107,9 @@ class Perl6::World is HLL::World {
)
}
}
else {
$*LANG.set_pragma($_.value, $on) for %isms;
}
}
else {
$RMD(" '$name' is not a valid pragma") if $RMD;

0 comments on commit 57f8927

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