Adds a parameter to enable the typesetting in commit ce211ac

This commit is contained in:
Casey Klein 2010-09-17 13:40:30 -05:00
parent 59213faf15
commit 17ac1fae3a
7 changed files with 17 additions and 3 deletions

View File

@ -82,7 +82,8 @@
'left-right/beside-side-conditions
'up-down
'up-down/vertical-side-conditions
'up-down/compact-side-conditions))])
'up-down/compact-side-conditions))]
[delimit-ellipsis-arguments? (parameter/c any/c)])
(provide/contract
[label-font-size (parameter/c (and/c (between/c 1 255) integer?))]

View File

@ -29,6 +29,7 @@
non-terminal
literal-style
metafunction-style
delimit-ellipsis-arguments?
open-white-square-bracket
close-white-square-bracket
just-before
@ -259,7 +260,8 @@
[(null? (cddr lst))
(cons (car lst) (loop (cdr lst)))]
[else
(if (eq? '... (lw-e (cadr lst)))
(if (and (not (delimit-ellipsis-arguments?))
(eq? '... (lw-e (cadr lst))))
(cons (car lst)
(loop (cdr lst)))
(list* (car lst)
@ -760,6 +762,7 @@
(define default-font-size (make-parameter 14))
(define metafunction-font-size (make-parameter (default-font-size)))
(define label-font-size (make-parameter 14))
(define delimit-ellipsis-arguments? (make-parameter #t))
(define (open-white-square-bracket) (white-bracket "["))
(define (close-white-square-bracket) (white-bracket "]"))

View File

@ -36,6 +36,7 @@
label-style
literal-style
metafunction-style
delimit-ellipsis-arguments?
label-font-size
default-font-size

View File

@ -2027,6 +2027,13 @@ The @racket['left-right/beside-side-conditions] variant is like
@racket['left-right], except it puts the side-conditions on the
same line, instead of on a new line below the case.}
@defparam[delimit-ellipsis-arguments? delimit? any/c]{
This parameter controls the typesetting of metafunction definitions
and applications. When it is non-@racket[#f] (the default), commas
precede ellipses that represent argument sequences; when it is
@racket[#f] no commas appear in those positions.
}
@defparam[linebreaks breaks (or/c #f (listof boolean?))]{
This parameter controls which cases in the metafunction
are rendered on two lines and which are rendered on one.

View File

@ -197,7 +197,9 @@
(where (x_3 ...) (rdups x_2 ...))]
[(rdups) ()])
(test (render-metafunction rdups) "rdups.png")
(test (render-metafunction rdups) "rdups-delimited.png")
(parameterize ([delimit-ellipsis-arguments? #f])
(test (render-metafunction rdups) "rdups-undelimited.png"))
;; Non-terminal superscripts
(test (render-lw lang (to-lw (x_^abcdef x_q^abcdef)))

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB