Adds a parameter to enable the typesetting in commit ce211ac
This commit is contained in:
parent
59213faf15
commit
17ac1fae3a
|
@ -82,7 +82,8 @@
|
||||||
'left-right/beside-side-conditions
|
'left-right/beside-side-conditions
|
||||||
'up-down
|
'up-down
|
||||||
'up-down/vertical-side-conditions
|
'up-down/vertical-side-conditions
|
||||||
'up-down/compact-side-conditions))])
|
'up-down/compact-side-conditions))]
|
||||||
|
[delimit-ellipsis-arguments? (parameter/c any/c)])
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
[label-font-size (parameter/c (and/c (between/c 1 255) integer?))]
|
[label-font-size (parameter/c (and/c (between/c 1 255) integer?))]
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
non-terminal
|
non-terminal
|
||||||
literal-style
|
literal-style
|
||||||
metafunction-style
|
metafunction-style
|
||||||
|
delimit-ellipsis-arguments?
|
||||||
open-white-square-bracket
|
open-white-square-bracket
|
||||||
close-white-square-bracket
|
close-white-square-bracket
|
||||||
just-before
|
just-before
|
||||||
|
@ -259,7 +260,8 @@
|
||||||
[(null? (cddr lst))
|
[(null? (cddr lst))
|
||||||
(cons (car lst) (loop (cdr lst)))]
|
(cons (car lst) (loop (cdr lst)))]
|
||||||
[else
|
[else
|
||||||
(if (eq? '... (lw-e (cadr lst)))
|
(if (and (not (delimit-ellipsis-arguments?))
|
||||||
|
(eq? '... (lw-e (cadr lst))))
|
||||||
(cons (car lst)
|
(cons (car lst)
|
||||||
(loop (cdr lst)))
|
(loop (cdr lst)))
|
||||||
(list* (car lst)
|
(list* (car lst)
|
||||||
|
@ -760,6 +762,7 @@
|
||||||
(define default-font-size (make-parameter 14))
|
(define default-font-size (make-parameter 14))
|
||||||
(define metafunction-font-size (make-parameter (default-font-size)))
|
(define metafunction-font-size (make-parameter (default-font-size)))
|
||||||
(define label-font-size (make-parameter 14))
|
(define label-font-size (make-parameter 14))
|
||||||
|
(define delimit-ellipsis-arguments? (make-parameter #t))
|
||||||
|
|
||||||
(define (open-white-square-bracket) (white-bracket "["))
|
(define (open-white-square-bracket) (white-bracket "["))
|
||||||
(define (close-white-square-bracket) (white-bracket "]"))
|
(define (close-white-square-bracket) (white-bracket "]"))
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
label-style
|
label-style
|
||||||
literal-style
|
literal-style
|
||||||
metafunction-style
|
metafunction-style
|
||||||
|
delimit-ellipsis-arguments?
|
||||||
|
|
||||||
label-font-size
|
label-font-size
|
||||||
default-font-size
|
default-font-size
|
||||||
|
|
|
@ -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
|
@racket['left-right], except it puts the side-conditions on the
|
||||||
same line, instead of on a new line below the case.}
|
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?))]{
|
@defparam[linebreaks breaks (or/c #f (listof boolean?))]{
|
||||||
This parameter controls which cases in the metafunction
|
This parameter controls which cases in the metafunction
|
||||||
are rendered on two lines and which are rendered on one.
|
are rendered on two lines and which are rendered on one.
|
||||||
|
|
|
@ -197,7 +197,9 @@
|
||||||
(where (x_3 ...) (rdups x_2 ...))]
|
(where (x_3 ...) (rdups x_2 ...))]
|
||||||
[(rdups) ()])
|
[(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
|
;; 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)))
|
||||||
|
|
BIN
collects/redex/tests/bmps-macosx/rdups-delimited.png
Normal file
BIN
collects/redex/tests/bmps-macosx/rdups-delimited.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue
Block a user