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:
parent
d41c62f579
commit
253f26085e
1 changed files with 8 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue