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

Commit

Permalink
Add regex debugging for cclass-based builtins.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Sep 1, 2010
1 parent 20477be commit 71b25e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Regex/Cursor-builtins.pir
Expand Up @@ -119,11 +119,23 @@ 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', name)
debug_1:
$I0 = is_cclass cclass, tgt, pos
unless $I0 goto fail
inc pos
pass:
cur.'!cursor_pass'(pos, name)
if null debug goto done
cur.'!cursor_debug'('PASS', name)
goto done
fail:
if null debug goto done
cur.'!cursor_debug'('FAIL', name)
done:
.return (cur)
.end

Expand Down

0 comments on commit 71b25e6

Please sign in to comment.