Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Add lang argument to Cursor.!cursor_start.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 15, 2009
1 parent ec4637c commit fbb15ef
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Regex/Cursor.pir
Expand Up @@ -201,15 +201,23 @@ Create a new cursor for matching C<target>.
.return (cur)
.end

=item !cursor_start()
=item !cursor_start([lang])

Create and initialize a new cursor from C<self>.
Create and initialize a new cursor from C<self>. If C<lang> is
provided, then the new cursor has the same type as lang.

=cut

.sub '!cursor_start' :method
.param pmc lang :optional
.param int has_lang :opt_flag

if has_lang goto have_lang
lang = self
have_lang:

.local pmc parrotclass, cur
$P0 = self.'HOW'()
$P0 = lang.'HOW'()
parrotclass = getattribute $P0, 'parrotclass'
cur = new parrotclass

Expand Down

0 comments on commit fbb15ef

Please sign in to comment.