#411 closed defect (fixed)
chicken-doc-admin + 4.6.2: Error: (irregex-match-start-index) not a valid index
Reported by: | Mario Domenech Goulart | Owned by: | Jim Ursetto |
---|---|---|---|
Priority: | major | Milestone: | 4.9.0 |
Component: | extensions | Version: | 4.6.x |
Keywords: | chicken-doc-admin, 4.6.2 | Cc: | |
Estimated difficulty: |
Description
Running chicken-doc-admin with chicken 4.6.2 gives me the following error:
$ chicken-doc-admin -m wiki/man/4 Error: (irregex-match-start-index) not a valid index #<regexp-match (8 submatches)> 8 Call history: ->string ensure-string1437 ->string setup-api#user-install-setup tcp-connect-timeout tcp-read-timeout tcp-write-timeout chicken-version conc make-parameter <--
$ chicken -version (c)2008-2010 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 4.6.2 linux-unix-gnu-x86 [ manyargs dload ptables ] compiled 2010-10-06 on mario (Linux)
Change History (7)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
My first guess is that irregex-match-start-index uses now vector-ref and this assumes a 0-based indexing scheme. Older version did not seem to have this requirement and other parts still think indices start at 1.
comment:3 Changed 14 years ago by
I don't believe so ckeen, because it works fine with regular submatches e.g. "(foo|bar|baz)". It does not work when you have submatches that alternate "(foo)|(bar)|(baz)" because in irregex, this is modeled as three submatches with two being #f. If irregex is changed to return #f instead of throw an error in this case (when the submatch index is within range but not present) this will automatically be fixed, otherwise the validity has to be tested for explicitly first.
comment:4 Changed 14 years ago by
I think this ought to work now, with the tweaked irregex version in newer dev versions?
comment:5 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Appears to be a behavior change (bug, I think) in string-search-positions, because irregex-match-start-index now throws an error instead of returning #f. Below is a simplified test case.
4.6.0
#;5> (string-search-positions "(foo)|(bar)|(baz)" "bar")
((0 3) (#f #f) (0 3) (#f #f))
4.6.2
#;2> (string-search-positions "(foo)|(bar)|(baz)" "bar")
Error: (irregex-match-start-index) not a valid index
#<regexp-match (3 submatches)>
3
The actual use case is a SRE like (or rx1 rx2 rx3) where the rx* contain submatches; in this case I want to ignore the submatches and just get the positions, which should be in the car of the result. However, 4.6.2 just refuses to build the result. Help?