chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #889: irregex-match-end gives odd results with chunke


From: Chicken Trac
Subject: [Chicken-janitors] #889: irregex-match-end gives odd results with chunked searches
Date: Wed, 25 Jul 2012 14:39:46 -0000

#889: irregex-match-end gives odd results with chunked searches
----------------------------+-----------------------------------------------
 Reporter:  megane          |       Owner:       
     Type:  defect          |      Status:  new  
 Priority:  major           |   Milestone:       
Component:  core libraries  |     Version:  4.7.x
 Keywords:  irregex         |  
----------------------------+-----------------------------------------------
 I expected (irregex-match-end-index m 0) to return 4 in the following
 example:

 {{{
 (let* ((chkr (make-irregex-chunker
               (lambda (c)
                 (and (pair? c)
                      (cdr c))) car))
        (m (irregex-search/chunked "(b)" chkr '("foo" "bar"))))
   (print m)
   (print (irregex-match-start-index m 0))
   (print (irregex-match-end-index m 0))
   (print (irregex-match-start-index m 1))
   (print (irregex-match-end-index m 1)))

 ;; #<regexp-match (1 submatch)>
 ;; 3
 ;; 1
 ;; 3
 ;; 1
 }}}

 The result with the version from http://code.google.com/p/irregex/ was:
 {{{
 #(*irregex-match-tag* #(#<procedure (? c)> #<procedure (car p)>
 #<procedure (? cnk)> #<procedure (? cnk)> #<procedure (? cnk1 start cnk2
 end)> #f) () (foo bar) 3 (bar) 1 (foo bar) 3 (bar) 1 #f #f #f #f)
 3
 1
 3
 1
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/889>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]