[ prog / sol / mona ]

prog


How can I run my own instance of this

94 2020-02-26 13:10

Irregex-search/backtrack uses irregex-nfa, which is just an accessor into the irregex representation, which is a vector. The nfa is index 3 in make-irregex, and is computed by the final branch of sre->irregex via sre->procedure. Sre->procedure composes a tree of lambdas over the tree of a SRE like '(** 0 3 (or "a" "ab")). The "case (car sre)" has (or) and (**) branches, the bug should be here.

With the benefit of hindsight, this can be gleaned from the REPL:

$ guile -l irregex.scm 
scheme@(guile-user)> (irregex '(** 0 3 (or "a" "ab")))
$2 = #(*irregex-tag* #f #f #<procedure 55af37871090 at irregex.scm:3161:21 (cnk init src str i end matches fail)> 0 0 #((0 . 6)) ())
scheme@(guile-user)> 

Irregex.scm:3161:21 is where the lambda of (**) lives.

301


VIP:

do not edit these