PR 10042 (plus some fixes to earlier Stevie-submitted PRs that werent quite right)

svn: r13447
This commit is contained in:
Robby Findler 2009-02-05 01:42:00 +00:00
parent 57208dfe14
commit 7e48db0a82
5 changed files with 31 additions and 28 deletions

View File

@ -92,5 +92,15 @@
(render-metafunction Name)) (render-metafunction Name))
"metafunction-Name-vertical.png") "metafunction-Name-vertical.png")
(define-metafunction lang
[(multi-arg a
b
c)
(multi-arg a
b
c)])
(test (render-metafunction multi-arg) "metafunction-multi-arg.png")
(printf "bitmap-test.ss: ") (printf "bitmap-test.ss: ")
(done) (done)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -188,16 +188,6 @@
(pair? (cdr content)) (pair? (cdr content))
(lw? (cadr content)) (lw? (cadr content))
(equal? 'term-let (lw-e (cadr content)))) (equal? 'term-let (lw-e (cadr content))))
#;
(struct-copy lw
an-lw
[e (adjust-spacing (lw-e (second-to-last content))
(lw-line an-lw)
(lw-line-span an-lw)
(lw-column an-lw)
(lw-column-span an-lw)
'term-let-rewriter)])
(struct-copy lw (struct-copy lw
an-lw an-lw
[e (append (list (just-before "" an-lw) 'spring) [e (append (list (just-before "" an-lw) 'spring)
@ -246,7 +236,7 @@
(pair? (cdr e)) (pair? (cdr e))
(lw? (cadr e)) (lw? (cadr e))
(lw-metafunction? (cadr e))) (lw-metafunction? (cadr e)))
(map ar/lw (adjust-spacing (rewrite-metafunction-app e) (map ar/lw (rewrite-metafunction-app e
line line-span col col-span line line-span col col-span
(lw-e (cadr e))))] (lw-e (cadr e))))]
[else [else
@ -266,20 +256,23 @@
snd snd
(car l))]))])) (car l))]))]))
(define (rewrite-metafunction-app lst) (define (rewrite-metafunction-app lst line line-span col col-span something-or-other)
(cons (hbl-append (list* 'spring
(just-after (hbl-append
(metafunction-text (symbol->string (lw-e (cadr lst)))) (metafunction-text (symbol->string (lw-e (cadr lst))))
(open-white-square-bracket)) (open-white-square-bracket))
(cadr lst))
'spring
(let loop ([lst (cddr lst)]) (let loop ([lst (cddr lst)])
(cond (cond
[(null? lst) null] [(null? lst) null]
[(null? (cdr lst)) [(null? (cdr lst))
(let ([last (car lst)]) (let ([last (car lst)])
(list (just-before (close-white-square-bracket) last) ""))] (list (just-before (close-white-square-bracket) last)))]
[(null? (cddr lst)) [(null? (cddr lst))
(cons (car lst) (loop (cdr lst)))] (cons (car lst) (loop (cdr lst)))]
[else (list* (car lst) [else (list* (car lst)
(basic-text ", " (default-style)) (just-after (basic-text "," (default-style)) (car lst))
(loop (cdr lst)))])))) (loop (cdr lst)))]))))
(define (just-before what lw) (define (just-before what lw)