From 253f26085e514a85105f924b3fc81ca1f3e08b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 6 Nov 2010 12:12:09 +0100 Subject: [PATCH] pretty-print: Suitably indent macro-related constructs. * module/ice-9/pretty-print.scm (generic-write)[pp-SYNTAX-CASE]: New procedure. [style]: Add support for `define-public', `define-syntax', `let-syntax', `letrec-syntax', `syntax-rules', and `syntax-case'. --- module/ice-9/pretty-print.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/ice-9/pretty-print.scm b/module/ice-9/pretty-print.scm index 8e67145f9..8e4cbac53 100644 --- a/module/ice-9/pretty-print.scm +++ b/module/ice-9/pretty-print.scm @@ -214,6 +214,9 @@ (define (pp-DO expr col extra) (pp-general expr col extra #f pp-expr-list pp-expr-list pp-expr)) + (define (pp-SYNTAX-CASE expr col extra) + (pp-general expr col extra #t pp-expr-list #f pp-expr)) + ; define formatting style (change these to suit your style) (define indent-general 2) @@ -224,7 +227,9 @@ (define (style head) (case head - ((lambda let* letrec define) pp-LAMBDA) + ((lambda let* letrec define define-public + define-syntax let-syntax letrec-syntax) + pp-LAMBDA) ((if set!) pp-IF) ((cond) pp-COND) ((case) pp-CASE) @@ -232,6 +237,8 @@ ((let) pp-LET) ((begin) pp-BEGIN) ((do) pp-DO) + ((syntax-rules) pp-LAMBDA) + ((syntax-case) pp-SYNTAX-CASE) (else #f))) (pr obj col 0 pp-expr))