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

Commit

Permalink
Adjust zerowidth handling slightly in enumcharlist.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 14, 2009
1 parent 982f190 commit 4d50dbc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/PAST/Compiler-Regex.pir
Expand Up @@ -526,20 +526,24 @@ character list.
.local string charlist
charlist = node[0]
charlist = self.'escape'(charlist)
.local pmc subtype, negate, testop
subtype = node.'subtype'()
.local pmc negate, testop
negate = node.'negate'()
testop = self.'??!!'(negate, 'ge', 'lt')
.local string subtype
.local int zerowidth
subtype = node.'subtype'()
zerowidth = iseq subtype, 'zerowidth'

ops.'push_pirop'('inline', negate, subtype, 'inline'=>' # rx enumcharlist negate=%0 %1')

ops.'push_pirop'('ge', pos, eos, fail)
ops.'push_pirop'('sub', '$I10', pos, off)
ops.'push_pirop'('substr', '$S10', tgt, '$I10', 1)
ops.'push_pirop'('index', '$I11', charlist, '$S10')
ops.'push_pirop'(testop, '$I11', 0, fail)
if subtype == 'zerowidth' goto skip_zerowidth
if zerowidth goto skip_zero_2
ops.'push_pirop'('inc', pos)
skip_zerowidth:
skip_zero_2:
.return (ops)
.end

Expand Down

0 comments on commit 4d50dbc

Please sign in to comment.