mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
309805f5e7
Complicated merge of Hoon 151. This commit is a major sequence point.
29 lines
644 B
Plaintext
29 lines
644 B
Plaintext
::
|
|
:::: /hoon/pretty/cat/gen
|
|
::
|
|
!:
|
|
|%
|
|
++ pretty-noun
|
|
|= pri=* ^- tank
|
|
?~ pri
|
|
leaf+"~"
|
|
?@ pri
|
|
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
|
|
=< rose+[" " ?:(- "~[" "[") "]"]^+
|
|
|- ^- [? (list tank)]
|
|
?~ +.pri
|
|
[& ^$(pri -.pri) ~]
|
|
?@ +.pri
|
|
[| ^$(pri -.pri) ^$(pri +.pri) ~]
|
|
[+< - +>]:[^$(pri -.pri) $(pri +.pri)]
|
|
::
|
|
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
|
|
::
|
|
++ pretty-file
|
|
=+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf+(trip b))))
|
|
|= fyl=* ^- tang
|
|
=+ `(unit wain)`?@(fyl `(lore fyl) ((soft wain) fyl))
|
|
?^ - (wain-to-tang u)
|
|
[(pretty-noun fyl)]~
|
|
--
|