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

Commit

Permalink
More peekability for enumcharclass nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 22, 2009
1 parent 40d3046 commit 503d396
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/PAST/Regex.pir
Expand Up @@ -188,17 +188,13 @@ at this node.
.local pmc negate
negate = self.'negate'()
unless negate goto negate_done
.return (prefix)
negate_done:
.local string charlist
.local string subtype, charlist
subtype = self.'subtype'()
charlist = self[0]
unless tail goto charlist_notail
if negate goto charlist_negate
.local string subtype
subtype = self.'subtype'()
unless tail goto charlist_notail
if subtype == 'zerowidth' goto charlist_notail
.local pmc result, head
Expand All @@ -223,6 +219,14 @@ at this node.
charlist_notail:
$P0 = split '', charlist
.return ($P0 :flat)
charlist_negate:
if subtype == 'zerowidth' goto charlist_negate_0
unless tail goto charlist_negate_0
.return (prefix)
charlist_negate_0:
head = shift tail
.tailcall head.'prefix'(prefix, tail :flat)
.end
Expand Down

0 comments on commit 503d396

Please sign in to comment.