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

Commit

Permalink
Add <before> builtin subrule.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 14, 2009
1 parent 3af996e commit 9ca78a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Regex/Cursor-builtins.pir
Expand Up @@ -11,6 +11,20 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects

.namespace ['Regex';'Cursor']

.sub 'before' :method
.param pmc regex :optional
.local pmc cur
.local int pos
(cur, pos) = self.'!cursor_start'()
if null regex goto fail
$P0 = cur.regex()
unless $P0 goto fail
cur.'!cursor_pass'(pos, 'before')
fail:
.return (cur)
.end


.sub 'ident' :method
.local pmc cur
.local int pos, eos
Expand Down
2 changes: 1 addition & 1 deletion t/p6regex/01-regex.t
Expand Up @@ -77,7 +77,7 @@ Description of the test.
push test_files, 'rx_backtrack'
push test_files, 'rx_charclass'
push test_files, 'rx_subrules'
# push test_files, 'rx_lookarounds'
push test_files, 'rx_lookarounds'
push test_files, 'rx_captures'
push test_files, 'rx_modifiers'
# push test_files, 'rx_syntax'
Expand Down

0 comments on commit 9ca78a9

Please sign in to comment.