1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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'.
This commit is contained in:
Ludovic Courtès 2010-11-06 12:12:09 +01:00
parent d41c62f579
commit 253f26085e

View file

@ -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))