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

Commit

Permalink
Fix negated zero-width enumcharlist at end of string (fixes issue #9
Browse files Browse the repository at this point in the history
…on github). Discovered by moritz++.
  • Loading branch information
pmichaud committed Sep 17, 2010
1 parent 8009d57 commit c9a989b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PAST/Compiler-Regex.pir
Expand Up @@ -747,7 +747,9 @@ character list.

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

if zerowidth goto skip_zero_1
ops.'push_pirop'('ge', pos, eos, fail)
skip_zero_1:
ops.'push_pirop'('sub', '$I10', pos, off)
ops.'push_pirop'('substr', '$S10', tgt, '$I10', 1)
ops.'push_pirop'('index', '$I11', charlist, '$S10')
Expand Down
2 changes: 2 additions & 0 deletions t/p6regex/rx_charclass
Expand Up @@ -80,4 +80,6 @@
<[A..Z0..9]> abcdef n two enumerated ranges
<[A..Z0..9]> abcDef y two enumerated ranges

abc <![d]> abc y negated charclass at end of string (issue #9)

## vim: noexpandtab tabstop=4 shiftwidth=4

0 comments on commit c9a989b

Please sign in to comment.