[gforth] / gforth / regexp.fs  

gforth: gforth/regexp.fs

Diff for /gforth/regexp.fs between version 1.19 and 1.20

version 1.19, Sun Sep 12 16:18:31 2010 UTC version 1.20, Sun Sep 12 16:44:04 2010 UTC
Line 135 
Line 135 
 : end-rex? ( addr -- addr flag ) dup end$ u< ;  : end-rex? ( addr -- addr flag ) dup end$ u< ;
 : start-rex? ( addr -- addr flag ) dup start$ u> ;  : start-rex? ( addr -- addr flag ) dup start$ u> ;
 : ?end ( addr -- addr ) ]] dup end$ u> ?LEAVE [[ ; immediate  : ?end ( addr -- addr ) ]] dup end$ u> ?LEAVE [[ ; immediate
   : rest$ ( addr -- addr addr u ) dup end$ over - ;
   
 \ start and end  \ start and end
   
Line 147 
Line 148 
   
 \ A word for string comparison  \ A word for string comparison
   
 : ,=" ( addr u -- ) tuck ]] dup SLiteral tuck compare ?LEAVE Literal + noop [[ ;  : =str ( addr1 addr u -- addr2 )
       dup >r 2>r rest$ r@ umin 2r> compare IF rdrop true ELSE r> + false THEN ;
   : $= ( addr1 addr u -- addr2 ) ]] =str ?LEAVE [[ ; immediate
   : ,=" ( addr u -- ) tuck dup ]] rest$ Literal umin SLiteral compare ?LEAVE Literal + noop [[ ;
 : =" ( <string>" -- ) \ regexp-pattern  : =" ( <string>" -- ) \ regexp-pattern
     \G check for string      \G check for string
     '" parse ,=" ; immediate      '" parse ,=" ; immediate


Generate output suitable for use with a patch program
Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help