Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions conventions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,38 @@
[_ (pretty doc)]))


;; condition: obj and name is flat
#;(send obj name
arg1
arg2)
;; general case
#;(send (make-obj arg1
arg2
arg3)
name
arg1
arg2)
#;(send obj name arg1 arg2)
(define-pretty format-send
#:type node?
(match/extract (node-content doc) #:as unfits tail
[([-send #t] [-obj #t] [-meth #f])
(define first-line (flatten (<+s> (pretty -obj) (pretty -meth))))
(define main-doc
(match tail
['() first-line]
[_ (<$> first-line
(try-indent #:n 0
#:because-of tail
((format-vertical/helper) tail)))]))

(alt (format-#%app doc)
(pretty-node #:unfits unfits
#:adjust '("(" ")")
(<+s> (pretty -send) main-doc)))]
[#:else (format-#%app doc)]))


(define-pretty format-if
#:type node?
(match/extract (node-content doc) #:as unfits tail
Expand Down Expand Up @@ -599,6 +631,8 @@

[("let") format-let]

[("send") format-send]

[("struct") format-struct]
[("define-struct") (format-uniform-body/helper 2 #:require-body? #f)]

Expand Down
Loading