Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#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:


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)>

        Call history:

        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 Jim Ursetto

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.


#;5> (string-search-positions "(foo)|(bar)|(baz)" "bar")
((0 3) (#f #f) (0 3) (#f #f))


#;2> (string-search-positions "(foo)|(bar)|(baz)" "bar")
Error: (irregex-match-start-index) not a valid index
#<regexp-match (3 submatches)>

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?

comment:2 Changed 14 years ago by Christian Kellermann

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 Jim Ursetto

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 13 years ago by sjamaan

I think this ought to work now, with the tweaked irregex version in newer dev versions?

comment:5 Changed 13 years ago by Jim Ursetto

Resolution: fixed
Status: newclosed

comment:6 Changed 13 years ago by felix winkelmann


Milestone 4.7.0 deleted

comment:7 Changed 12 years ago by felix winkelmann


Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.