Skip to content

Commit 628e050

Browse files
committed
Load the Regex library by default; NQP users expect Regex::Match and so forth to be to hand by default. Recovers some of the broken tests.
1 parent 5613e50 commit 628e050

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/NQP/Actions.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ class NQP::Actions is HLL::Actions {
188188
# setting.
189189
my $SETTING := $*SC.load_setting(%*COMPILING<%?OPTIONS><setting> // 'NQPCORE');
190190

191-
# If it exports HOWs, grab them.
191+
# If it exports HOWs, grab them. Also, if we're loading the
192+
# setting, also by default load Regex library (we can't load
193+
# this in the setting as Regex depends on the setting).
192194
unless %*COMPILING<%?OPTIONS><setting> eq 'NULL' {
193195
import_HOW_exports($SETTING);
196+
$*SC.load_module('Regex', $*GLOBALish);
194197
}
195198
}
196199
self.SET_BLOCK_OUTER_CTX(@BLOCK[0]);

src/NQP/Grammar.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,13 @@ grammar NQP::Grammar is HLL::Grammar {
106106
:my $*HAS_YOU_ARE_HERE := 0;
107107
:my $*MAIN_SUB;
108108
<.newpad>
109-
<.outerctx>
110109

111110
:my $*PACKAGE;
112111
:my $*GLOBALish;
113112
<.GLOBALish>
114113

114+
<.outerctx>
115+
115116
<statementlist>
116117
[ $ || <.panic: 'Confused'> ]
117118
}

0 commit comments

Comments
 (0)