2017-11-29 23:14:58 +03:00
|
|
|
:: Untyped best-guess printer
|
2016-02-05 05:57:44 +03:00
|
|
|
::
|
2017-11-29 23:14:58 +03:00
|
|
|
:::: /hoon/pretty-file/lib
|
2016-02-05 05:57:44 +03:00
|
|
|
::
|
2016-02-17 04:40:32 +03:00
|
|
|
/? 310
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2017-11-29 23:14:58 +03:00
|
|
|
=< pretty-file
|
2015-05-28 05:46:58 +03:00
|
|
|
|%
|
|
|
|
++ pretty-noun
|
2020-11-25 23:22:55 +03:00
|
|
|
|= pri=* ^- tank
|
2015-05-28 05:46:58 +03:00
|
|
|
?~ pri
|
2016-01-26 03:52:58 +03:00
|
|
|
leaf+"~"
|
2015-05-28 05:46:58 +03:00
|
|
|
?@ pri
|
2016-01-26 03:52:58 +03:00
|
|
|
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
|
|
|
|
=< rose+[" " ?:(- "~[" "[") "]"]^+
|
2020-11-26 17:09:31 +03:00
|
|
|
|- ^- [? (list tank)]
|
2015-05-28 05:46:58 +03:00
|
|
|
?~ +.pri
|
|
|
|
[& ^$(pri -.pri) ~]
|
|
|
|
?@ +.pri
|
|
|
|
[| ^$(pri -.pri) ^$(pri +.pri) ~]
|
|
|
|
[+< - +>]:[^$(pri -.pri) $(pri +.pri)]
|
|
|
|
::
|
2020-11-25 23:22:55 +03:00
|
|
|
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
|
2015-05-28 05:46:58 +03:00
|
|
|
::
|
2020-11-25 23:22:55 +03:00
|
|
|
++ wain-to-tang |=(a=wain (turn a |=(b=cord leaf+(trip b))))
|
2015-05-28 05:46:58 +03:00
|
|
|
++ pretty-file
|
2020-11-25 23:22:55 +03:00
|
|
|
|= fyl=* ^- tang
|
2017-03-29 00:18:59 +03:00
|
|
|
=+ `(unit wain)`?@(fyl `(to-wain:format fyl) ((soft wain) fyl))
|
2015-05-28 05:46:58 +03:00
|
|
|
?^ - (wain-to-tang u)
|
|
|
|
[(pretty-noun fyl)]~
|
|
|
|
--
|