From 04cc3052b67f3bc7a1d6a93aedca319610e68c84 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 21 Feb 2010 21:32:34 -0800 Subject: [PATCH] alien.prettyprint: pprint pointer objects as "type*" in c-type contexts --- basis/alien/prettyprint/prettyprint.factor | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/basis/alien/prettyprint/prettyprint.factor b/basis/alien/prettyprint/prettyprint.factor index 489ea0b10a..52e9978a5f 100644 --- a/basis/alien/prettyprint/prettyprint.factor +++ b/basis/alien/prettyprint/prettyprint.factor @@ -19,9 +19,19 @@ M: c-type-word definer drop \ C-TYPE: f ; M: c-type-word definition drop f ; M: c-type-word declarations. drop ; +> ; +M: pointer pointer-string to>> pointer-string [ CHAR: * suffix ] [ f ] if* ; +PRIVATE> + GENERIC: pprint-c-type ( c-type -- ) M: word pprint-c-type pprint-word ; -M: pointer pprint-c-type pprint* ; +M: pointer pprint-c-type + dup pointer-string + [ swap present-text ] + [ pprint* ] if* ; M: wrapper pprint-c-type wrapped>> pprint-word ; M: string pprint-c-type text ; M: array pprint-c-type pprint* ;