### Diff for /gforth/substitute.fs between versions 1.1 and 1.3

version 1.1, 2012/07/05 22:25:10 version 1.3, 2012/07/14 13:18:04
Line 31  Variable macro\$ Line 31  Variable macro\$
'%' \$split 2swap dup 0= IF                      '%' \$split 2swap dup 0= IF
2drop s" %" macro\$ \$+! r> 1+ >r                          2drop s" %" macro\$ \$+! r> 1+ >r
ELSE                      ELSE
2dup macros-wordlist search-wordlist  IF                          macros-wordlist search-wordlist  IF
execute 2swap 2drop r> 1+ >r macro\$ \$+!                              -rot 2>r execute macro\$ \$+! 2r> r> 1+ >r
ELSE  2drop  THEN                          THEN
THEN                      THEN
THEN                  THEN
THEN              THEN
Line 44  Variable macro\$ Line 44  Variable macro\$
\G result to @var{addr2 len2}.  @var{n} is the number of      \G result to @var{addr2 len2}.  @var{n} is the number of
\G substitutions, @var{addr2 len3} the result.  If      \G substitutions, @var{addr2 len3} the result.  If
\G @var{len2}=@var{len3}, it is likely that the string did not fit.      \G @var{len2}=@var{len3}, it is likely that the string did not fit.
2swap \$substitute >r      2>r \$substitute -rot
2swap rot umin 2dup >r >r move r> r> r> ;      2r> rot umin 2dup 2>r move 2r> rot ;

: unescapes ( addr1 u1 dest -- dest u2 )  : unescapes ( addr1 u1 dest -- dest u2 )
\G double all delimiters in @var{addr1 u1}, so that substitute      \G double all delimiters in @var{addr1 u1}, so that substitute

 Removed from v.1.1 changed lines Added in v.1.3

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