File:  [gforth] / gforth / colorize.fs
Revision 1.1: download - view: text, annotated - select for diffs
Tue Nov 29 16:50:24 1994 UTC (27 years ago) by pazsan
Branches: MAIN
CVS tags: HEAD
* forgotten file

    1: \ COLORIZE.STR  Coloured .NAME and WORDS                20may93jaw
    2: 
    3: include ansi.fs
    4: 
    5: decimal
    6: 
    7: CREATE CT 30 cells allot
    8: : CT! cells CT + ! ;
    9: : CT@ cells CT + @ ;
   10: 
   11: VARIABLE Color 20 Color !
   12: 
   13: : Color: Color @ 1 Color +! constant ;
   14: 
   15: Color: Hig#
   16: 
   17: <A White >f A>          0 CT!
   18: <A White >f bold A>     Ali# CT!
   19: <A Brown >f A>          Con# CT!
   20: <A Green >f A>          Var# CT!
   21: <A Cyan >f A>           Def# CT!
   22: <A Yellow >f A>         Val# CT!
   23: <A Brown >f bold A>     Doe# CT!
   24: <A Yellow >f bold A>    Col# CT!
   25: <A Blue >f bold A>      Pri# CT!
   26: <A Red >f bold A>       Str# CT!
   27: <A Green >f bold A>     Com# CT!
   28: <A Red >b A>            Hig# CT!
   29: 
   30: : (.name) ( lfa -- )
   31:         cell+ dup
   32:         wordinfo cells ct + @ attr!
   33:         count $1f and type blackspace ;
   34: 
   35: : .name (.name) ct @ attr! ;
   36: 
   37: : words  context @
   38:          BEGIN  @ dup  WHILE  dup (.name)  REPEAT drop
   39:          ct @ attr! ;
   40: 

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