Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make fiddling with Cursor internals scarier, jnthn++.
  • Loading branch information
peschwa committed Mar 26, 2015
1 parent 8aeba2a commit 315106c
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions src/QRegex/Cursor.nqp
Expand Up @@ -36,22 +36,8 @@ role NQPCursorRole is export {
has $!regexsub;
has $!restart;

method orig($value = '') {
my $orig := nqp::getattr($!shared, ParseShared, '$!orig');
if $value ne '' {
$orig := $orig ~ $value;
nqp::bindattr($!shared, ParseShared, '$!orig', $orig);
}
$orig
}
method target($value = '') {
my $target := nqp::getattr_s($!shared, ParseShared, '$!target');
if $value ne '' {
$target := $target ~ $value;
nqp::bindattr_s($!shared, ParseShared, '$!target', $target);
}
$target
}
method orig() { nqp::getattr($!shared, ParseShared, '$!orig') }
method target() { nqp::getattr_s($!shared, ParseShared, '$!target') }
method from() { $!from }
method pos() { $!pos }

Expand All @@ -62,6 +48,15 @@ role NQPCursorRole is export {
$!regexsub := NQPMu;
}

method !APPEND_TO_ORIG($value) {
my $orig := nqp::getattr($!shared, ParseShared, '$!orig');
$orig := $orig ~ $value;
nqp::bindattr($!shared, ParseShared, '$!orig', $orig);
my $target := nqp::getattr_s($!shared, ParseShared, '$!target');
$target := $target ~ $value;
nqp::bindattr_s($!shared, ParseShared, '$!target', $target);
}

my $NO_CAPS := nqp::hash();
method CAPHASH() {
my $caps := nqp::hash();
Expand Down

0 comments on commit 315106c

Please sign in to comment.