adjusted metafunction application rendering so that ellipses do not

get commas put in front of them
This commit is contained in:
Robby Findler 2010-09-17 11:39:07 -05:00
parent c6fc7137ee
commit ce211ac364
3 changed files with 19 additions and 3 deletions

View File

@ -258,9 +258,13 @@
(just-after (close-white-square-bracket) last)))] (just-after (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
(if (eq? '... (lw-e (cadr lst)))
(cons (car lst)
(loop (cdr lst)))
(list* (car lst)
(just-after (basic-text "," (default-style)) (car lst)) (just-after (basic-text "," (default-style)) (car lst))
(loop (cdr lst)))])))) (loop (cdr lst))))]))))
(define (just-before what lw) (define (just-before what lw)
(build-lw (if (symbol? what) (build-lw (if (symbol? what)

View File

@ -187,6 +187,18 @@
;; make sure two metafunctions simultaneously rewritten line up properly ;; make sure two metafunctions simultaneously rewritten line up properly
(test (render-metafunctions S T TL) "metafunctions-multiple.png") (test (render-metafunctions S T TL) "metafunctions-multiple.png")
;; make sure that the ellipses don't have commas before them.
(define-metafunction lang
rdups : x ... -> (x ...)
[(rdups x_1 x_2 ... x_1 x_3 ...)
(rdups x_2 ... x_1 x_3 ...)]
[(rdups x_1 x_2 ...)
(x_1 x_3 ...)
(where (x_3 ...) (rdups x_2 ...))]
[(rdups) ()])
(test (render-metafunction rdups) "rdups.png")
;; Non-terminal superscripts ;; Non-terminal superscripts
(test (render-lw lang (to-lw (x_^abcdef x_q^abcdef))) (test (render-lw lang (to-lw (x_^abcdef x_q^abcdef)))
"superscripts.png") "superscripts.png")

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB