Skip to content

Instantly share code, notes, and snippets.

@niner
Last active March 16, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niner/c82676810ce4fb2d4aee50e0ef086ef6 to your computer and use it in GitHub Desktop.
Save niner/c82676810ce4fb2d4aee50e0ef086ef6 to your computer and use it in GitHub Desktop.
diff --git a/src/NQP/Grammar.nqp b/src/NQP/Grammar.nqp
index d1f37c9e0..693acc7e5 100644
--- a/src/NQP/Grammar.nqp
+++ b/src/NQP/Grammar.nqp
@@ -1,4 +1,5 @@
grammar NQP::Grammar is HLL::Grammar {
+ my $sc_id := 0;
method TOP() {
# Language braid.
my $*LANG := self;
@@ -23,7 +24,7 @@ grammar NQP::Grammar is HLL::Grammar {
# with this compilation unit.
my $file := nqp::getlexdyn('$?FILES');
my $source_id := nqp::sha1(self.target()) ~
- (%*COMPILING<%?OPTIONS><stable-sc> ?? '' !! '-' ~ ~nqp::time_n());
+ (%*COMPILING<%?OPTIONS><stable-sc> ?? '' !! '-' ~ ~($sc_id++));
my $*W := nqp::isnull($file) ??
NQP::World.new(:handle($source_id)) !!
NQP::World.new(:handle($source_id), :description($file));
diff --git a/src/QRegex/P6Regex/Actions.nqp b/src/QRegex/P6Regex/Actions.nqp
index 70bc97f3c..752409371 100644
--- a/src/QRegex/P6Regex/Actions.nqp
+++ b/src/QRegex/P6Regex/Actions.nqp
@@ -946,7 +946,7 @@ class QRegex::P6Regex::Actions is HLL::Actions {
self.alt_nfas($code_obj, $block, $_);
nqp::push(@alternatives, QRegex::NFA.new.addnode($_));
}
- $ast.name(QAST::Node.unique('alt_nfa_') ~ '_' ~ ~nqp::time_n());
+ $ast.name(QAST::Node.unique('alt_nfa_') ~ '_' ~ $*W.handle());
self.store_regex_alt_nfa($code_obj, $block, $ast.name, @alternatives);
}
elsif $rxtype eq 'subcapture' || $rxtype eq 'quant' {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment