2017-08-29 02:42:44 +03:00
|
|
|
|%
|
|
|
|
++ static :: freeze .mdh hoon subset
|
2017-11-20 03:36:52 +03:00
|
|
|
|= gen/hoon ^- {inf/(map term dime) elm/manx}
|
2017-08-29 02:42:44 +03:00
|
|
|
?+ -.gen
|
|
|
|
=/ gen ~(open ap gen)
|
|
|
|
?: =(gen ^gen) ~|([%cram-dynamic -.gen] !!)
|
|
|
|
$(gen gen)
|
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%xray [~ (single (shut gen))]
|
2017-08-29 02:42:44 +03:00
|
|
|
^ [(malt (frontmatter p.gen)) (single (shut q.gen))]
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ single :: unwrap one-elem marl
|
|
|
|
|= xml/marl ^- manx
|
2018-03-19 07:18:20 +03:00
|
|
|
?: ?=({* ~} xml) i.xml
|
2017-08-29 02:42:44 +03:00
|
|
|
~|(%many-elems !!)
|
|
|
|
::
|
|
|
|
++ shut-mart :: xml attrs
|
2018-08-20 02:06:19 +03:00
|
|
|
|=({n/mane v/(list beer:hoot)} [n (turn v |=(a/beer:hoot ?^(a !! a)))])
|
2017-08-29 02:42:44 +03:00
|
|
|
::
|
|
|
|
++ shut :: as xml constant
|
2017-11-20 03:36:52 +03:00
|
|
|
|= gen/hoon ^- marl
|
2017-08-29 02:42:44 +03:00
|
|
|
?+ -.gen ~|([%bad-xml -.gen] !!)
|
2020-11-25 22:39:13 +03:00
|
|
|
%dbug $(gen q.gen)
|
2017-08-29 02:42:44 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%xray
|
2018-03-18 04:06:15 +03:00
|
|
|
[[n.g.p.gen (turn a.g.p.gen shut-mart)] $(gen [%mcts c.p.gen])]~
|
2017-08-29 02:42:44 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%mcts
|
2017-08-29 02:42:44 +03:00
|
|
|
?~ p.gen ~
|
|
|
|
=- (weld - $(p.gen t.p.gen))
|
2017-10-31 23:21:53 +03:00
|
|
|
?^ -.i.p.gen $(gen [%xray i.p.gen])
|
2017-08-29 02:42:44 +03:00
|
|
|
~| [%shut-tuna -.i.p.gen]
|
|
|
|
?+ -.i.p.gen !!
|
2020-11-25 22:39:13 +03:00
|
|
|
%manx ?>(?=(%xray -.p.i.p.gen) $(gen p.i.p.gen))
|
|
|
|
%marl ?>(?=(%mcts -.p.i.p.gen) $(gen p.i.p.gen))
|
2017-08-29 02:42:44 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::
|
|
|
|
++ frontmatter :: parse ~[[%foo 1] [%bar ~s2]]
|
2017-11-20 03:36:52 +03:00
|
|
|
|= gen/hoon ^- (list {term dime})
|
2020-11-25 22:39:13 +03:00
|
|
|
?: ?=({%bust %null} gen) ~
|
|
|
|
?: ?=(%dbug -.gen) $(gen q.gen)
|
|
|
|
?. ?=(%clsg -.gen) ~|([%bad-frontmatter -.gen] !!)
|
2017-08-29 02:42:44 +03:00
|
|
|
%+ turn p.gen
|
2017-11-20 03:36:52 +03:00
|
|
|
|= gen/hoon
|
2017-08-29 02:42:44 +03:00
|
|
|
?. ?=(^ -.gen)
|
|
|
|
=/ gen ~(open ap gen)
|
|
|
|
?: =(gen ^gen) ~|([%bad-frontmatter-elem -.gen] !!)
|
|
|
|
$(gen gen)
|
|
|
|
=/ hed (as-dime p.gen)
|
|
|
|
?. =(%tas p.hed) ~|([%bad-frontmatter-key-type p.hed] !!)
|
|
|
|
[q.hed (as-dime q.gen)]
|
|
|
|
::
|
|
|
|
++ as-dime :: %foo ~.foo 0vbar etc
|
2017-11-20 03:36:52 +03:00
|
|
|
|= gen/hoon ^- dime
|
2020-11-25 22:39:13 +03:00
|
|
|
?: ?=(%dbug -.gen) $(gen q.gen)
|
|
|
|
?. ?=({?(%rock %sand) @ @} gen) ~|([%bad-literal gen] !!)
|
2017-08-29 02:42:44 +03:00
|
|
|
+.gen
|
|
|
|
--
|