adjusted metafunction application rendering so that ellipses do not
get commas put in front of them
This commit is contained in:
parent
c6fc7137ee
commit
ce211ac364
|
@ -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
|
||||||
(just-after (basic-text "," (default-style)) (car lst))
|
(if (eq? '... (lw-e (cadr lst)))
|
||||||
(loop (cdr lst)))]))))
|
(cons (car lst)
|
||||||
|
(loop (cdr lst)))
|
||||||
|
(list* (car lst)
|
||||||
|
(just-after (basic-text "," (default-style)) (car lst))
|
||||||
|
(loop (cdr lst))))]))))
|
||||||
|
|
||||||
(define (just-before what lw)
|
(define (just-before what lw)
|
||||||
(build-lw (if (symbol? what)
|
(build-lw (if (symbol? what)
|
||||||
|
|
|
@ -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")
|
||||||
|
|
BIN
collects/redex/tests/bmps-macosx/rdups.png
Normal file
BIN
collects/redex/tests/bmps-macosx/rdups.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue
Block a user