Diff for /gforth/regexp-test.fs between versions 1.18 and 1.21

version 1.18, 2010/09/12 22:14:12 version 1.21, 2010/12/27 22:39:38
Line 178  s" bla 45296s fasel 117s blubber" str= [ Line 178  s" bla 45296s fasel 117s blubber" str= [
 ?depth  ?depth
   
 : hms>s,del() ( addr u -- addr' u' )  : hms>s,del() ( addr u -- addr' u' )
   s// {{ ` ( .? .? .? ` ) >> <<" ()"    s// {{ ` ( // ` ) >> <<" ()"
       || \( \d \d \) ` : \( \d \d \) ` : \( \d \d \)        || \( \d \d \) ` : \( \d \d \) ` : \( \d \d \)
          >> \1 s>number drop 60 *           >> \1 s>number drop 60 *
             \2 s>number drop + 60 *              \2 s>number drop + 60 *
             \3 s>number drop + 0 <# 's' hold #s #> <<              \3 s>number drop + 0 <# 's' hold #s #> <<
       }} LEAVE //s ;        }} LEAVE //s ;
   
 \ doesn't work yet  
 s" (bla) 12:34:56 (fasel) 00:01:57 (blubber)" 2dup type hms>s,del() ."  -> " type cr  s" (bla) 12:34:56 (fasel) 00:01:57 (blubber)" 2dup type hms>s,del() ."  -> " type cr
   
   \ more tests from David K├╝hling
   
   require test/ttester.fs
   
   : underflow1  ( c-addr u -- flag )
      (( {{
            {{ ` - || }} \d
            || \d
         }} )) ;
   T{ s" -1dummy" underflow1 -> true }T
   
   : underflow2  ( -- )
      (( \( {{ \s {** \s **} 
            || =" /*" // =" */"
            || =" //" {** \d **} }} \) )) ;
   T{ s" /*10203030203030404*/   " underflow2 -> true }T
   T{ pad 0 underflow2 -> false }T
   
   charclass [*] '* +char
   charclass [*/] '* +char '/ +char
   
   : underflow3  ( -- )
      ((
         =" /*"
         \( {** {{ [*] -c? || ` * [*/] -c? }}  **} \)
         {++ ` * ++} ` /
      )) ;
   
   \ this still seems to be too complicated
   T{ s" /*10203030203030404*/   " underflow3 -> true }T
   \1 type cr
   
   : underflow4  ( -- )
      (( \( {{ {** \d **} || {** \d **} }} \d \) )) ;
   
   T{ s" 0  " underflow4 -> true }T
   
 script? [IF] bye [THEN]  script? [IF] bye [THEN]

Removed from v.1.18  
changed lines
  Added in v.1.21


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>