Skip to content

Commit

Permalink
Merge pull request #711 from MasterDuke17/finish_getting_rid_of_NQPCu…
Browse files Browse the repository at this point in the history
…rsor

Finish getting rid of NQPCursor
  • Loading branch information
MasterDuke17 committed Apr 8, 2021
2 parents 8b2fd66 + 531ac30 commit 0bc2117
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/NQP/World.nqp
Expand Up @@ -632,10 +632,6 @@ class NQP::World is HLL::World {
if nqp::existskey($result.WHO, ~$_) {
$result := ($result.WHO){$_};
}
# XXX temp shim to avoid bootstrapping funniness
elsif nqp::elems(@name) == 1 && @name[0] eq 'NQPCursor' {
return self.find_sym(['NQPMatch']);
}
else {
nqp::die("Could not locate compile-time value for symbol " ~
join('::', @name));
Expand Down
2 changes: 0 additions & 2 deletions src/QRegex/Cursor.nqp
Expand Up @@ -1272,8 +1272,6 @@ class NQPMatch is NQPCapture does NQPMatchRole {
}
}

my constant NQPCursor := NQPMatch;

class NQPRegexMethod {
has $!code;
method new($code) {
Expand Down
8 changes: 4 additions & 4 deletions t/nqp/050-regex.t
@@ -1,15 +1,15 @@
plan(7);

ok(NQPCursor.parse('a', :rule(/<alpha>/), :p(0)),
ok(NQPMatch.parse('a', :rule(/<alpha>/), :p(0)),
'Can parse "a" with <alpha> and :p(0)');

ok(!NQPCursor.parse('a', :rule(/<alpha>/), :p(1)),
ok(!NQPMatch.parse('a', :rule(/<alpha>/), :p(1)),
'Can parse "a" with <alpha> :p(off-range)');

ok(!NQPCursor.parse('a', :rule(/<alpha>/), :c(1)),
ok(!NQPMatch.parse('a', :rule(/<alpha>/), :c(1)),
'Can parse "a" with <alpha> :c(off-range)');

ok(!NQPCursor.parse('a', :rule(/<alpha>/), :p(5)),
ok(!NQPMatch.parse('a', :rule(/<alpha>/), :p(5)),
'Can parse "a" with <alpha> :p(far-off-range)');

ok(?('ABC' ~~ /:i abc/), ':i works with literals');
Expand Down
2 changes: 1 addition & 1 deletion t/p5regex/01-p5regex.t
Expand Up @@ -38,7 +38,7 @@ sub test_line($line) {
my $rxcomp := nqp::getcomp('QRegex::P5Regex');
try {
my $rxsub := $rxcomp.compile($regex);
my $cursor := NQPCursor."!cursor_init"($target, :c(0));
my $cursor := NQPMatch."!cursor_init"($target, :c(0));
my $match := $rxsub($cursor).MATCH;
if $expect_substr {
my $got := ~$match."!dump_str"('mob');
Expand Down
2 changes: 1 addition & 1 deletion t/qregex/01-qregex.t
Expand Up @@ -48,7 +48,7 @@ sub test_line($line) {
my $rxcomp := nqp::getcomp('QRegex::P6Regex');
try {
my $rxsub := $rxcomp.compile($regex);
my $cursor := NQPCursor."!cursor_init"($target, :c(0));
my $cursor := NQPMatch."!cursor_init"($target, :c(0));
my $match := $rxsub($cursor).MATCH;

if $expect_error {
Expand Down
2 changes: 1 addition & 1 deletion tools/build/process-qregex-tests
Expand Up @@ -8,7 +8,7 @@ sub test_line($rxsub,$target,$expect,$desc) {
!! "";
try {
my $cursor := NQPCursor."!cursor_init"($target, :c(0));
my $cursor := NQPMatch."!cursor_init"($target, :c(0));
my $match := $rxsub($cursor).MATCH;
if $expect_substr {
my $got := ~$match."!dump_str"("mob");
Expand Down

0 comments on commit 0bc2117

Please sign in to comment.