Diff for /gforth/utf-8.fs between versions 1.40 and 1.41

version 1.40, 2009/12/31 15:32:35 version 1.41, 2010/02/14 18:04:16
Line 273  here wc-table - Constant #wc-table Line 273  here wc-table - Constant #wc-table
   
 \ inefficient table walk:  \ inefficient table walk:
   
 : wcwidth ( xc -- n )  : xc-width ( xc -- n )
     wc-table #wc-table over + swap ?DO      wc-table #wc-table over + swap ?DO
         dup I 2@ within IF  I 2 cells + @  UNLOOP EXIT  THEN          dup I 2@ within IF  I 2 cells + @  UNLOOP EXIT  THEN
     3 cells +LOOP  1 ;      3 cells +LOOP  1 ;
   [ELSE]
       ' wcwidth Alias xc-width
 [THEN]  [THEN]
           
 : u8width ( xcaddr u -- n )  : u8width ( xcaddr u -- n )
     0 rot rot over + swap ?DO      0 rot rot over + swap ?DO
         I xc@+ swap >r wcwidth +          I xc@+ swap >r xc-width +
     r> I - +LOOP ;      r> I - +LOOP ;
   
 : set-encoding-utf-8 ( -- )  : set-encoding-utf-8 ( -- )

Removed from v.1.40  
changed lines
  Added in v.1.41


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