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

Commit

Permalink
Add debugging output to <alpha>.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Sep 1, 2010
1 parent 71b25e6 commit 29ce78f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Regex/Cursor-builtins.pir
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
.local int pos
.local string tgt
(cur, pos, tgt) = self.'!cursor_start'()
.local pmc debug
debug = getattribute cur, '$!debug'
if null debug goto debug_1
cur.'!cursor_debug'('START', 'alpha')
debug_1:
$I0 = is_cclass .CCLASS_ALPHABETIC, tgt, pos
if $I0 goto pass

Expand All @@ -155,7 +160,13 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
pass:
inc pos
cur.'!cursor_pass'(pos, 'alpha')
if null debug goto done
cur.'!cursor_debug'('PASS', 'alpha')
goto done
fail:
if null debug goto done
cur.'!cursor_debug'('FAIL', 'alpha')
done:
.return (cur)
.end

Expand Down

0 comments on commit 29ce78f

Please sign in to comment.