Summary

chicken-doc-admin + 4.6.2: Error: (irregex-match-start-index) not a valid index

Metadata

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)

Changes and comments

[2010-10-09 02:34:53 UTC] zbigniew wrote:

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?

[2010-10-18 14:43:48 UTC] ckeen wrote:

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.

[2010-10-18 20:18:13 UTC] zbigniew wrote:

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.

[2010-12-12 14:34:30 UTC] sjamaan wrote:

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

[2010-12-17 06:34:53 UTC] zbigniew changed status from new to closed

[2010-12-17 06:34:53 UTC] zbigniew set resolution to fixed

[2011-06-01 09:00:41 UTC] felix changed milestone from 4.7.0 to 4.8.0

[2011-06-01 09:00:41 UTC] felix wrote:

Milestone 4.7.0 deleted

[2012-09-24 21:47:48 UTC] felix wrote:

Milestone 4.8.0 deleted

[2012-09-24 21:47:48 UTC] felix changed milestone from 4.8.0 to 4.9.0