]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/prettyprint/prettyprint.factor
Merge branch 'master' of git://factorcode.org/git/factor into c-type-words
[factor.git] / basis / alien / prettyprint / prettyprint.factor
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel combinators alien alien.strings alien.c-types
4 alien.syntax math.parser prettyprint.backend prettyprint.custom
5 prettyprint.sections definitions see see.private ;
6 IN: alien.prettyprint
7
8 M: alien pprint*
9     {
10         { [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
11         { [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
12         [ \ ALIEN: [ alien-address >hex text ] pprint-prefix ]
13     } cond ;
14
15 M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
16
17 M: c-type-word definer drop \ C-TYPE: f ;
18 M: c-type-word definition drop f ;
19
20 M: typedef-word see-class*
21     <colon
22     \ TYPEDEF: pprint-word
23     dup "typedef" word-prop pprint-word
24     pprint-word
25     block> ;