2016-01-26 03:52:58 +03:00
|
|
|
::
|
2016-02-11 03:41:28 +03:00
|
|
|
:::: /hoon/frontmatter/lib
|
2016-01-26 03:52:58 +03:00
|
|
|
::
|
2016-02-18 02:36:43 +03:00
|
|
|
/? 310
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2016-12-03 01:14:39 +03:00
|
|
|
=, format
|
2016-01-26 03:52:58 +03:00
|
|
|
|%
|
|
|
|
++ atr-lines
|
|
|
|
|= atr/(map cord cord)
|
2017-02-13 23:43:18 +03:00
|
|
|
%+ turn (sort ~(tap by atr) |=({{a/@ @} {b/@ @}} (aor a b)))
|
2016-01-26 03:52:58 +03:00
|
|
|
|= {k/cord v/cord}
|
|
|
|
(rap 3 k ': ' v ~)
|
|
|
|
::
|
|
|
|
++ atr-key ;~(sfix (star ;~(less col prn)) col ace)
|
|
|
|
++ print
|
|
|
|
|= {atr/(map cord cord) src/wain}
|
|
|
|
?~ atr src
|
|
|
|
['---' (welp (atr-lines atr) '---' src)]
|
|
|
|
++ parse
|
|
|
|
=| atr/(map cord cord)
|
|
|
|
|= wan/wain ^+ [atr mud='']
|
|
|
|
?~ wan [~ '']
|
|
|
|
?^ (rush i.wan (star ace))
|
|
|
|
$(wan t.wan)
|
2016-12-03 01:14:39 +03:00
|
|
|
?. =('---' i.wan) [~ (of-wain wan)]
|
2016-01-26 03:52:58 +03:00
|
|
|
|- ^+ [atr mud='']
|
|
|
|
?~ t.wan ~|(%unclosed-metadata !!)
|
2016-12-03 01:14:39 +03:00
|
|
|
?: =('---' i.t.wan) [atr (of-wain t.t.wan)]
|
2016-01-26 03:52:58 +03:00
|
|
|
?^ (rush i.t.wan (star ace))
|
|
|
|
$(wan t.wan)
|
|
|
|
=- $(wan t.wan, atr (~(put by atr) (crip key) (crip val)))
|
|
|
|
~| malformed-attribute+i.t.wan
|
|
|
|
^- {key/tape ^ val/tape}
|
|
|
|
+>:(atr-key 1^1 (trip i.t.wan))
|
|
|
|
--
|