Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement <.print> and <.graph> rules.
  • Loading branch information
jnthn committed Sep 23, 2015
1 parent 8304e17 commit bf1d2ad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/QRegex/Cursor.nqp
Expand Up @@ -716,6 +716,15 @@ role NQPCursorRole is export {
$cur;
}

method print() {
my $cur := self."!cursor_start_cur"();
my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
$cur."!cursor_pass"($!pos+1, 'print')
if $!pos < nqp::chars($target)
&& nqp::iscclass(nqp::const::CCLASS_PRINTING, $target, $!pos);
$cur;
}

method cntrl() {
my $cur := self."!cursor_start_cur"();
my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
Expand All @@ -734,6 +743,16 @@ role NQPCursorRole is export {
$cur;
}

method graph() {
my $cur := self."!cursor_start_cur"();
my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
$cur."!cursor_pass"($!pos+1, 'graph')
if $!pos < nqp::chars($target)
&& (nqp::iscclass(nqp::const::CCLASS_ALPHANUMERIC, $target, $!pos)
|| nqp::iscclass(nqp::const::CCLASS_PUNCTUATION, $target, $!pos));
$cur;
}

method FAILGOAL($goal, $dba?) {
self."!cursor_start_cur"()
}
Expand Down

0 comments on commit bf1d2ad

Please sign in to comment.