Skip to content

Commit

Permalink
compact-vertical-min-width was always 0 and it doesn't seem to actual…
Browse files Browse the repository at this point in the history
…ly work in any meaningful way, so let's get rid of it
  • Loading branch information
rfindler committed Jan 3, 2024
1 parent 001310b commit 1744e8c
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions redex-pict-lib/redex/private/pict.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
metafunction-cases
judgment-form-cases
judgment-form-show-rule-names
compact-vertical-min-width
extend-language-show-union
extend-language-show-extended-order
set-arrow-pict!
Expand Down Expand Up @@ -326,29 +325,27 @@
rps)
(blank 0 (reduction-relation-rule-separation)))))))

(define compact-vertical-min-width (make-parameter 0))

(define rule-picts->pict/vertical
(make-vertical-style vr-append))

(define rule-picts->pict/vertical-overlapping-side-conditions
(make-vertical-style rbl-superimpose))

(define (rule-picts->pict/compact-vertical rps)
(let* ([max-w (apply max
(compact-vertical-min-width)
(map pict-width
(append
(map rule-pict-info-lhs rps)
(map rule-pict-info-rhs rps))))]
(let* ([max-w
(apply max
(map pict-width
(append
(map rule-pict-info-lhs rps)
(map rule-pict-info-rhs rps))))]
[scs (map (lambda (rp)
(rule-pict-info->side-condition-pict rp max-w))
rps)]
[labels (map (lambda (rp)
(hbl-append (blank (label-space) 0) (rp->pict-label rp)))
rps)]
[total-w (apply max
max-w
max-w ; max-width-of-rule-picts
(append (map pict-width scs)
(map (lambda (lbl)
(+ max-w 2 (label-space) (pict-width lbl)))
Expand All @@ -360,8 +357,6 @@
[lhs (rule-pict-info-lhs rp)]
[rhs (rule-pict-info-rhs rp)]
[spc (basic-text " " (default-style))]
[sep (blank (compact-vertical-min-width)
(reduction-relation-rule-separation))]
[add-label (lambda (p label)
(htl-append
p
Expand All @@ -378,14 +373,13 @@
(list arrow rhs)
(list (blank) sc)))))])
(define rowss
(map one-line rps scs labels))
(map one-line rps scs labels))
(define all-cols
(let ([min-left (blank (compact-vertical-min-width) 0)])
(for*/fold ([all-cols (list min-left (blank))]) ([rows (in-list rowss)]
[row (in-list rows)])
(for/list ([col (in-list all-cols)]
[p (in-list row)])
(ltl-superimpose col (blank (pict-width p) 0))))))
(for*/fold ([all-cols (list (blank) (blank))]) ([rows (in-list rowss)]
[row (in-list rows)])
(for/list ([col (in-list all-cols)]
[p (in-list row)])
(ltl-superimpose col (blank (pict-width p) 0)))))
(apply vl-append
(+ (reduction-relation-rule-extra-separation)
(reduction-relation-rule-separation))
Expand Down

0 comments on commit 1744e8c

Please sign in to comment.