added horizontal-left-align style

svn: r14687
This commit is contained in:
Robby Findler 2009-05-02 12:32:04 +00:00
parent a7ad3ce74c
commit ea1ace6022
3 changed files with 19 additions and 12 deletions

View File

@ -12,6 +12,7 @@
(symbols 'compact-vertical
'vertical
'vertical-overlapping-side-conditions
'horizontal-left-align
'horizontal))
(provide reduction-rule-style/c)

View File

@ -127,7 +127,7 @@
(define current-label-extra-space (make-parameter 0))
(define reduction-relation-rule-separation (make-parameter 4))
(define (rule-picts->pict/horizontal rps)
(define ((rule-picts->pict/horizontal left-column-align) rps)
(let* ([sep 2]
[max-rhs (apply max
0
@ -160,8 +160,8 @@
(blank)
sep (blank) (blank) (blank))))
rps))
(list* rtl-superimpose ctl-superimpose ltl-superimpose)
(list* rtl-superimpose ctl-superimpose ltl-superimpose)
(list* left-column-align ctl-superimpose ltl-superimpose)
(list* left-column-align ctl-superimpose ltl-superimpose)
(list* sep sep (+ sep (current-label-extra-space))) 2)))
(define arrow-space (make-parameter 0))
@ -326,7 +326,10 @@
[(compact-vertical) rule-picts->pict/compact-vertical]
[(vertical-overlapping-side-conditions)
rule-picts->pict/vertical-overlapping-side-conditions]
[else rule-picts->pict/horizontal]))
[(horizontal-left-align)
(rule-picts->pict/horizontal ltl-superimpose)]
[else ;; horizontal
(rule-picts->pict/horizontal rtl-superimpose)]))
(define (mk-arrow-pict sz style)
(let ([cache (make-hash)])

View File

@ -1672,14 +1672,17 @@ multi-line right-hand sides.
This parameter controls the style used by default for the reduction
relation. It can be @scheme['horizontal], where the left and
right-hand sides of the reduction rule are beside each other
or @scheme['vertical], where the left and right-hand sides of the
reduction rule are above each other.
The @scheme['compact-vertical] style moves the reduction arrow
to the second line and uses less space between lines.
Finally, in the @scheme['vertical-overlapping-side-conditions] variant, the side-conditions don't contribute to
the width of the pict, but are just overlaid on the second
line of each rule.
right-hand sides of the reduction rule are beside each other or
@scheme['vertical], where the left and right-hand sides of the
reduction rule are above each other. The @scheme['compact-vertical]
style moves the reduction arrow to the second line and uses less space
between lines. The @scheme['vertical-overlapping-side-conditions]
variant, the side-conditions don't contribute to the width of the
pict, but are just overlaid on the second line of each rule. The
@scheme['horizontal-left-align] style is like the @scheme['horizontal]
style, but the left-hand sides of the rules are aligned on the left,
instead of on the right.
}
@defthing[reduction-rule-style/c flat-contract?]{