factor/basis/alien/prettyprint/prettyprint.factor

26 lines
797 B
Factor
Raw Normal View History

2008-12-08 15:58:00 -05:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2009-09-15 16:18:54 -04:00
USING: kernel combinators alien alien.strings alien.c-types
alien.syntax math.parser prettyprint.backend prettyprint.custom
prettyprint.sections definitions see see.private ;
2008-12-08 15:58:00 -05:00
IN: alien.prettyprint
M: alien pprint*
{
{ [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
{ [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
[ \ ALIEN: [ alien-address >hex text ] pprint-prefix ]
2008-12-08 15:58:00 -05:00
} cond ;
M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
2009-09-15 16:18:54 -04:00
M: c-type-word definer drop \ C-TYPE: f ;
M: c-type-word definition drop f ;
M: typedef-word see-class*
<colon
\ TYPEDEF: pprint-word
dup "typedef" word-prop pprint-word
pprint-word
block> ;