2022-06-30 18:39:06 +03:00
|
|
|
/- *sole
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: a library for printing doccords
|
2022-06-30 23:27:06 +03:00
|
|
|
::
|
2022-06-30 23:58:45 +03:00
|
|
|
=/ debug |
|
2022-03-30 21:51:40 +03:00
|
|
|
=>
|
2022-11-22 00:04:25 +03:00
|
|
|
:: dprint-types
|
2022-11-16 01:48:07 +03:00
|
|
|
|%
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: $overview: an overview of all named things in the type.
|
|
|
|
::
|
|
|
|
:: each element in the overview list is either a documentation for a sublist
|
|
|
|
:: or an association betwen a term and documentation for it
|
2022-03-30 21:51:40 +03:00
|
|
|
+$ overview (list overview-item)
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: $overview-item: an element of an overview
|
2022-03-30 21:51:40 +03:00
|
|
|
+$ overview-item
|
|
|
|
$% [%header doc=what children=overview]
|
|
|
|
[%item name=tape doc=what]
|
|
|
|
==
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: $item: the part of a type being inspected
|
2022-03-30 21:51:40 +03:00
|
|
|
+$ item
|
|
|
|
$%
|
|
|
|
:: overview of a type
|
|
|
|
::
|
|
|
|
[%view items=overview]
|
|
|
|
:: inspecting a full core
|
|
|
|
$: %core
|
|
|
|
name=tape
|
|
|
|
docs=what
|
|
|
|
sut=type
|
|
|
|
con=coil
|
|
|
|
children=(unit item)
|
|
|
|
==
|
|
|
|
:: inspecting a single arm on a core
|
|
|
|
$: %arm
|
|
|
|
name=tape
|
2022-04-05 22:52:35 +03:00
|
|
|
adoc=what
|
|
|
|
pdoc=what
|
|
|
|
cdoc=what
|
2022-03-30 21:51:40 +03:00
|
|
|
gen=hoon
|
|
|
|
sut=type
|
|
|
|
==
|
|
|
|
:: inspecting a face and what's behind it
|
|
|
|
$: %face
|
|
|
|
name=tape
|
|
|
|
docs=what
|
|
|
|
children=(unit item)
|
|
|
|
==
|
|
|
|
:: inspecting a single chapter on a core
|
|
|
|
$: %chapter
|
|
|
|
name=tape
|
|
|
|
docs=what
|
|
|
|
sut=type
|
|
|
|
con=coil
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
--
|
2022-11-22 00:04:25 +03:00
|
|
|
:: dprint
|
|
|
|
::
|
|
|
|
:: core containing doccords search and printing utilities
|
2022-11-16 01:48:07 +03:00
|
|
|
|%
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: contains arms used for looking for docs inside of a type
|
|
|
|
::
|
|
|
|
:: the entrypoint for finding docs within a type is +find-item-in-type.
|
2022-04-04 23:23:27 +03:00
|
|
|
+| %searching
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +find-item-in-type: returns the item to print while searching through topic
|
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
:: this gate is a thin wrapper around _hunt for usability, since the only entry
|
|
|
|
:: point most users should care about is find-item:hunt
|
|
|
|
::
|
2022-03-30 21:51:40 +03:00
|
|
|
++ find-item-in-type
|
2022-06-30 23:56:04 +03:00
|
|
|
|= [topics=(list term) sut=type]
|
2022-11-23 00:26:16 +03:00
|
|
|
?~ topics !!
|
|
|
|
=/ top=(lest term) topics
|
|
|
|
~(find-item hunt [top sut])
|
|
|
|
::
|
|
|
|
:: +hunt: door used for refining the type while searching for doccords
|
|
|
|
::
|
|
|
|
++ hunt
|
|
|
|
|_ [topics=(lest term) sut=type]
|
|
|
|
++ this .
|
|
|
|
::+| %find
|
|
|
|
++ find-item
|
|
|
|
^- (unit item)
|
|
|
|
?- sut
|
|
|
|
%noun ~
|
|
|
|
%void ~
|
|
|
|
[%atom *] ~
|
|
|
|
[%cell *] find-cell
|
|
|
|
[%core *] find-core
|
|
|
|
[%face *] find-face
|
|
|
|
[%fork *] find-fork
|
|
|
|
[%hint *] find-hint
|
|
|
|
[%hold *] find-item:this(sut (~(play ut p.sut) q.sut))
|
|
|
|
==
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ find-cell
|
|
|
|
?> ?=([%cell *] sut)
|
|
|
|
=/ lhs find-item:this(sut p.sut)
|
2022-03-30 21:51:40 +03:00
|
|
|
?~ lhs
|
2022-11-23 00:26:16 +03:00
|
|
|
find-item:this(sut q.sut)
|
2022-03-30 21:51:40 +03:00
|
|
|
lhs
|
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ find-core
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
?: check-arm
|
|
|
|
?: check-search
|
|
|
|
?: check-arm-core
|
|
|
|
return-arm-core
|
|
|
|
return-arm
|
|
|
|
recurse-arm-core
|
|
|
|
?: check-chap
|
|
|
|
?: check-search
|
|
|
|
return-chap
|
|
|
|
recurse-chap
|
|
|
|
recurse-core
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ find-face
|
|
|
|
?> ?=([%face *] sut)
|
2022-03-30 21:51:40 +03:00
|
|
|
?. ?=(term p.sut)
|
2022-11-23 00:26:16 +03:00
|
|
|
::TODO: handle $tune case
|
|
|
|
find-item:this(sut q.sut)
|
2022-04-07 00:37:55 +03:00
|
|
|
?. =(i.topics p.sut)
|
2022-03-30 21:51:40 +03:00
|
|
|
~
|
2022-04-07 00:37:55 +03:00
|
|
|
?~ t.topics
|
2022-11-23 00:26:16 +03:00
|
|
|
return-face
|
|
|
|
find-item:this(sut q.sut, topics t.topics)
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ find-fork
|
|
|
|
?> ?=([%fork *] sut)
|
2022-03-30 21:51:40 +03:00
|
|
|
=/ types=(list type) ~(tap in p.sut)
|
|
|
|
|-
|
2022-11-23 00:26:16 +03:00
|
|
|
?~ types ~
|
|
|
|
=+ res=find-item:this(sut i.types)
|
2022-03-30 21:51:40 +03:00
|
|
|
?~ res
|
|
|
|
$(types t.types)
|
|
|
|
res
|
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ find-hint
|
|
|
|
|^
|
|
|
|
?> ?=([%hint *] sut)
|
|
|
|
?. ?=([%help *] q.p.sut)
|
|
|
|
find-item:this(sut q.sut)
|
|
|
|
?+ q.sut ~
|
|
|
|
[%cell *] find-cell:this(sut q.sut)
|
|
|
|
[%core *] find-hint-core
|
|
|
|
[%face *] find-hint-face
|
|
|
|
[%fork *] find-fork:this(sut q.sut)
|
|
|
|
[%hint *] find-hint:this(sut q.sut)
|
|
|
|
[%hold *] find-hint:this(q.sut (~(play ut p.q.sut) q.q.sut))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ find-hint-core
|
|
|
|
?> &(?=([%hint *] sut) ?=([%help *] q.p.sut) ?=([%core *] q.sut))
|
|
|
|
::
|
|
|
|
?. ?& ((sane %tas) summary.crib.p.q.p.sut)
|
|
|
|
=(summary.crib.p.q.p.sut i.topics)
|
|
|
|
==
|
|
|
|
find-core:this(sut q.sut)
|
|
|
|
?~ t.topics
|
|
|
|
return-hint-core
|
|
|
|
find-item:this(sut q.sut, topics t.topics)
|
|
|
|
::
|
|
|
|
++ find-hint-face
|
|
|
|
?> &(?=([%hint *] sut) ?=([%help *] q.p.sut) ?=([%face *] q.sut))
|
|
|
|
?: check-face:this(sut q.sut)
|
|
|
|
?~ t.topics
|
|
|
|
return-hint-face
|
|
|
|
find-item:this(sut q.q.sut, topics t.topics)
|
|
|
|
find-item:this(sut q.q.sut)
|
|
|
|
--
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
::+| %recurse
|
|
|
|
++ recurse-core
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
find-item:this(sut p.sut)
|
|
|
|
++ recurse-chap
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
?~ t.topics !!
|
|
|
|
find-item:this(topics t.topics)
|
|
|
|
++ recurse-arm-core
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
?~ t.topics !!
|
|
|
|
find-item:this(sut arm-type, topics t.topics)
|
2022-06-09 18:33:29 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
::+| %check
|
|
|
|
++ check-arm !=(~ (find ~[i.topics] (sloe sut)))
|
|
|
|
++ check-chap
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
(~(has by q.r.q.sut) i.topics)
|
|
|
|
++ check-face
|
|
|
|
?> ?=([%face *] sut)
|
|
|
|
?. ?=(term p.sut)
|
|
|
|
::TODO: handle $tune case
|
|
|
|
%.n
|
|
|
|
=(p.sut i.topics)
|
|
|
|
++ check-search =(~ t.topics)
|
|
|
|
++ check-arm-core
|
|
|
|
^- ?
|
|
|
|
=+ arm-list=(sloe (~(play ut sut) arm-hoon))
|
|
|
|
&(!=(arm-list ~) !=(arm-list ~[%$]))
|
2022-11-22 01:20:28 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
::+| %return
|
|
|
|
++ return-core
|
2022-06-09 18:04:09 +03:00
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%core *] sut)
|
2022-11-23 00:26:16 +03:00
|
|
|
=* compiled-against find-item:this(sut p.sut)
|
|
|
|
`[%core (trip i.topics) *what sut q.sut compiled-against]
|
2022-03-31 21:39:09 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ return-face
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%face *] sut)
|
|
|
|
:: TODO: handle tune case
|
|
|
|
?> ?=(term p.sut)
|
|
|
|
=* compiled-against return-item:this(sut q.sut)
|
2022-03-31 21:39:09 +03:00
|
|
|
`[%face (trip p.sut) *what compiled-against]
|
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
++ return-fork
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%fork *] sut)
|
2022-04-01 00:33:59 +03:00
|
|
|
=* types ~(tap in p.sut)
|
2022-11-23 00:26:16 +03:00
|
|
|
=* items (turn types |=(a=type return-item:this(sut a)))
|
2022-04-01 00:33:59 +03:00
|
|
|
(roll items join-items)
|
2022-11-23 00:26:16 +03:00
|
|
|
::
|
|
|
|
++ return-hint
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%hint *] sut)
|
|
|
|
=* res return-item:this(sut q.sut)
|
|
|
|
?. ?=([%help *] q.p.sut)
|
2022-06-09 21:40:45 +03:00
|
|
|
~
|
2022-11-23 00:26:16 +03:00
|
|
|
`[%view [%header `crib.p.q.p.sut (item-as-overview res)]~]
|
|
|
|
::
|
|
|
|
++ return-arm
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
=+ [adoc pdoc cdoc]=(all-arm-docs arm-hoon sut (trip i.topics))
|
|
|
|
::TODO: should this p.sut be sut? or the compiled type of the arm?
|
|
|
|
`[%arm (trip i.topics) adoc pdoc cdoc arm-hoon p.sut]
|
|
|
|
::
|
|
|
|
++ return-chap
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
=/ tom=tome (~(got by q.r.q.sut) i.topics)
|
|
|
|
`[%chapter (trip i.topics) p.tom sut q.sut]
|
|
|
|
::
|
|
|
|
++ return-arm-core
|
|
|
|
^- (unit item)
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
=+ [adoc pdoc cdoc]=(all-arm-docs arm-hoon sut (trip i.topics))
|
|
|
|
=/ dox=what ?~(adoc ?~(pdoc ~ pdoc) adoc)
|
|
|
|
=/ at arm-type
|
|
|
|
?> ?=([%core *] at)
|
|
|
|
=* compiled-against return-item:this(sut p.sut)
|
|
|
|
`[%core (trip i.topics) dox at q.at compiled-against]
|
|
|
|
::
|
|
|
|
++ return-item
|
|
|
|
^- (unit item)
|
|
|
|
?- sut
|
|
|
|
%noun ~
|
|
|
|
%void ~
|
|
|
|
[%atom *] ~
|
|
|
|
[%cell *] (join-items return-item:this(sut p.sut) return-item:this(sut q.sut))
|
|
|
|
[%core *] return-core
|
|
|
|
[%face *] return-face
|
|
|
|
[%fork *] return-fork
|
|
|
|
[%hint *] return-hint
|
|
|
|
[%hold *] return-item:this(sut (~(play ut p.sut) q.sut))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ return-hint-core
|
|
|
|
^- (unit item)
|
|
|
|
?> &(?=([%hint *] sut) ?=([%core *] q.sut))
|
|
|
|
(apply-hint return-core:this(sut q.sut))
|
|
|
|
::
|
|
|
|
++ return-hint-face
|
|
|
|
^- (unit item)
|
|
|
|
?> &(?=([%hint *] sut) ?=([%face *] q.sut))
|
|
|
|
(apply-hint return-face:this(sut q.sut))
|
|
|
|
::
|
|
|
|
++ apply-hint
|
|
|
|
|= uit=(unit item)
|
|
|
|
^- (unit item)
|
|
|
|
?~ uit ~
|
|
|
|
?> &(?=([%hint *] sut) ?=([%help *] q.p.sut))
|
|
|
|
?+ u.uit ~
|
|
|
|
?([%core *] [%face *]) (some u.uit(docs `crib.p.q.p.sut))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::+| %misc
|
|
|
|
++ arm-hoon
|
|
|
|
^- hoon
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
(need (^arm-hoon i.topics q.sut))
|
|
|
|
::
|
|
|
|
++ arm-type
|
|
|
|
^- type
|
|
|
|
?> ?=([%core *] sut)
|
|
|
|
(~(play ut sut) arm-hoon)
|
|
|
|
--
|
2022-03-31 21:39:09 +03:00
|
|
|
::
|
2022-11-23 00:26:16 +03:00
|
|
|
:: +arm-hoon: looks for an arm in a coil and returns its hoon
|
|
|
|
++ arm-hoon
|
2022-03-30 21:51:40 +03:00
|
|
|
|= [arm-name=term con=coil]
|
2022-11-23 00:26:16 +03:00
|
|
|
~? >> debug %arm-hoon
|
2022-03-30 21:51:40 +03:00
|
|
|
^- (unit hoon)
|
|
|
|
=/ tomes=(list [p=term q=tome]) ~(tap by q.r.con)
|
|
|
|
|-
|
|
|
|
?~ tomes
|
|
|
|
~
|
2022-04-01 00:33:59 +03:00
|
|
|
=+ gen=(~(get by q.q.i.tomes) arm-name)
|
|
|
|
?~ gen
|
2022-03-30 21:51:40 +03:00
|
|
|
$(tomes t.tomes)
|
2022-04-01 00:33:59 +03:00
|
|
|
`u.gen
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +help-from-hint: gets the help from a %help $hint and returns it as a unit
|
2022-04-05 22:17:57 +03:00
|
|
|
++ help-from-hint
|
|
|
|
|= sut=type
|
|
|
|
^- (unit help)
|
|
|
|
?+ sut ~
|
|
|
|
[%hold *]
|
2022-06-09 21:40:45 +03:00
|
|
|
~? >> debug %help-from-hold
|
|
|
|
$(sut (~(play ut p.sut) q.sut))
|
2022-04-05 22:17:57 +03:00
|
|
|
::
|
|
|
|
[%hint *]
|
|
|
|
~? >> debug %help-from-hint
|
|
|
|
?. ?=(%help -.q.p.sut)
|
|
|
|
~
|
2022-04-05 22:52:35 +03:00
|
|
|
`p.q.p.sut
|
2022-04-05 22:17:57 +03:00
|
|
|
==
|
2022-03-31 21:39:09 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +arm-product-docs: returns 0, 1, or 2 whats for an arm
|
|
|
|
::
|
|
|
|
:: this arm should be handed the compiled type of the hoon of an arm, as well
|
|
|
|
:: as the name of that arm. it checks for up to 2 nested hints on the outermost
|
|
|
|
:: layer of the type. if you have 2, it is presumed to be arm-doc followed by
|
|
|
|
:: product-doc. if you only have one, we check .cuff in the $help of the hint
|
|
|
|
:: to determine whether it is an arm doc or product doc.
|
|
|
|
::
|
|
|
|
:: this returns ~ if there are no docs. if there are docs, the first one is the
|
|
|
|
:: arm-doc, and the second one is the product-doc.
|
|
|
|
::
|
2022-04-05 19:38:02 +03:00
|
|
|
++ arm-product-docs
|
2022-04-05 22:17:57 +03:00
|
|
|
|= [sut=type name=term]
|
2022-04-05 19:38:02 +03:00
|
|
|
^- (unit [what what])
|
|
|
|
=/ doc-one=(unit help)
|
2022-04-05 22:17:57 +03:00
|
|
|
(help-from-hint sut)
|
2022-04-05 19:38:02 +03:00
|
|
|
?~ doc-one
|
2022-04-05 22:17:57 +03:00
|
|
|
~? > debug %doc-one-empty
|
|
|
|
~ :: no need to look for a second doc if there is no first one
|
2022-07-06 23:31:07 +03:00
|
|
|
?: =(~ cuff.u.doc-one)
|
2022-06-08 22:39:40 +03:00
|
|
|
:: doc-one is a product-doc
|
|
|
|
[~ [~ `crib.u.doc-one]]
|
2022-07-06 23:31:07 +03:00
|
|
|
?: !=(name ->.cuff.u.doc-one)
|
2022-06-08 22:39:40 +03:00
|
|
|
:: link on doc-one doesnt match arm name, so that means its calling a
|
|
|
|
:: different arm and trying to use its docs. don't let it
|
|
|
|
~
|
|
|
|
~? > debug :- %doc-one doc-one
|
2022-04-05 19:38:02 +03:00
|
|
|
=/ doc-two=(unit help)
|
2022-06-09 21:40:45 +03:00
|
|
|
?. ?=([%hint *] sut)
|
2022-06-08 22:39:40 +03:00
|
|
|
~
|
2022-06-09 21:40:45 +03:00
|
|
|
(help-from-hint q.sut)
|
2022-04-05 19:38:02 +03:00
|
|
|
?~ doc-two
|
2022-04-05 22:17:57 +03:00
|
|
|
~? > debug %doc-two-empty
|
2022-07-06 23:31:07 +03:00
|
|
|
:: if .cuff is non-empty, check that the link is for the arm
|
|
|
|
?: =(name ->.cuff.u.doc-one)
|
2022-04-05 22:17:57 +03:00
|
|
|
~? > debug %link-match
|
2022-04-05 22:52:35 +03:00
|
|
|
[~ [`crib.u.doc-one ~]]
|
2022-04-05 19:38:02 +03:00
|
|
|
~? > debug %link-doesnt-match-arm
|
2022-06-08 22:39:40 +03:00
|
|
|
:: this can happen if +bar calls +foo which has doccords
|
2022-04-05 22:52:35 +03:00
|
|
|
[~ [`crib.u.doc-one ~]]
|
2022-06-09 21:40:45 +03:00
|
|
|
:: doc-two is non-empty. make sure that doc-one is an arm-doc for this arm
|
2022-07-06 23:31:07 +03:00
|
|
|
?> =(name ->.cuff.u.doc-one)
|
2022-04-05 22:52:35 +03:00
|
|
|
[~ [`crib.u.doc-one `crib.u.doc-two]]
|
2022-04-05 19:38:02 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +all-arm-docs: grabs the docs for an arm.
|
|
|
|
::
|
|
|
|
:: there are three possible places with relevant docs for an arm:
|
|
|
|
:: docs for the arm itself, docs for the product of the arm, and
|
|
|
|
:: if the arm builds a core, docs for the default arm of that core.
|
|
|
|
::
|
|
|
|
:: arm-doc: docs written above the the arm
|
|
|
|
:: product-doc: docs for the product of the arm
|
|
|
|
:: core-doc: docs for the default arm of the core produced by the arm
|
|
|
|
:: this will be the first of the arm-doc or product-doc on the default
|
|
|
|
:: arm. maybe this should be recursive and/or give both but its a decision
|
|
|
|
:: ill leave for later
|
|
|
|
::
|
2022-04-05 22:17:57 +03:00
|
|
|
++ all-arm-docs
|
2022-04-05 19:38:02 +03:00
|
|
|
|= [gen=hoon sut=type name=tape]
|
2022-04-05 22:17:57 +03:00
|
|
|
~? > debug %all-arm-docs
|
2022-03-30 21:51:40 +03:00
|
|
|
^- [what what what]
|
2022-03-31 21:39:09 +03:00
|
|
|
=+ hoon-type=(~(play ut sut) gen)
|
2022-04-05 22:17:57 +03:00
|
|
|
=+ arm-prod=(arm-product-docs hoon-type `@tas`(crip name))
|
2022-04-05 19:38:02 +03:00
|
|
|
|^
|
2022-04-05 21:44:47 +03:00
|
|
|
:: check arm-prod to determine how many layers to look into the type
|
2022-04-05 19:38:02 +03:00
|
|
|
:: for core docs
|
2022-04-05 21:44:47 +03:00
|
|
|
=/ depth=@ ?~ arm-prod 0
|
|
|
|
(add =(~ +<.arm-prod) =(~ +>.arm-prod))
|
2022-04-05 22:17:57 +03:00
|
|
|
?+ depth ``~
|
|
|
|
%0 ``(extract hoon-type)
|
2022-04-05 19:38:02 +03:00
|
|
|
%1 :+ +<.arm-prod
|
|
|
|
+>.arm-prod
|
|
|
|
?> ?=([%hint *] hoon-type)
|
2022-04-05 22:17:57 +03:00
|
|
|
(extract q.hoon-type)
|
2022-04-05 19:38:02 +03:00
|
|
|
%2 :+ +<.arm-prod
|
|
|
|
+>.arm-prod
|
|
|
|
?> ?=([%hint *] hoon-type)
|
|
|
|
?> ?=([%hint *] q.hoon-type)
|
2022-04-05 22:17:57 +03:00
|
|
|
(extract q.q.hoon-type)
|
2022-04-05 19:38:02 +03:00
|
|
|
==
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +extract: grabs the first doc for the default arm of a core
|
|
|
|
::
|
|
|
|
:: this could end up being an arm doc or a product doc.
|
|
|
|
::
|
2022-04-05 22:17:57 +03:00
|
|
|
++ extract
|
2022-04-05 19:38:02 +03:00
|
|
|
|= sut=type
|
|
|
|
^- what
|
2022-04-06 23:34:02 +03:00
|
|
|
?. ?=([%core *] sut)
|
|
|
|
~? > debug %no-nested-core ~
|
|
|
|
~? > debug %found-nested-core
|
2022-11-23 00:26:16 +03:00
|
|
|
=+ carm=(arm-hoon %$ q.sut)
|
2022-04-06 23:34:02 +03:00
|
|
|
?~ carm ~? > debug %empty-carm ~
|
|
|
|
~? > debug %found-default-arm
|
2022-06-08 22:41:04 +03:00
|
|
|
=+ carm-type=(~(play ut sut) u.carm)
|
2022-06-09 21:40:45 +03:00
|
|
|
=/ hel=(unit help) (help-from-hint carm-type)
|
|
|
|
?~ hel
|
|
|
|
~
|
|
|
|
`what``crib.u.hel
|
2022-04-05 19:38:02 +03:00
|
|
|
--
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +arm-and-chapter-overviews: returns an overview of a cores contents
|
|
|
|
::
|
|
|
|
:: returns an overview for arms which are part of unnamed chapters, and
|
|
|
|
:: an overview of the named chapters
|
|
|
|
::
|
2022-03-31 21:39:09 +03:00
|
|
|
++ arm-and-chapter-overviews
|
|
|
|
|= [sut=type con=coil core-name=tape]
|
|
|
|
^- [overview overview]
|
|
|
|
=| arm-docs=overview
|
|
|
|
=| chapter-docs=overview
|
|
|
|
=/ tomes ~(tap by q.r.con)
|
|
|
|
|-
|
|
|
|
?~ tomes
|
|
|
|
[(sort-overview arm-docs) (sort-overview chapter-docs)]
|
|
|
|
=* current i.tomes ::[term tome]
|
|
|
|
?~ p.current
|
|
|
|
:: chapter has no name. add documentation for its arms to arm-docs
|
|
|
|
=. arm-docs (weld arm-docs (arms-as-overview q.q.current sut))
|
|
|
|
$(tomes t.tomes)
|
|
|
|
:: chapter has a name. add to list of chapters
|
|
|
|
=. chapter-docs
|
|
|
|
%+ weld chapter-docs
|
|
|
|
^- overview
|
2022-07-06 23:21:13 +03:00
|
|
|
[%item :(weld "^" core-name "|" (trip -.current)) p.q.current]~
|
2022-03-31 21:39:09 +03:00
|
|
|
$(tomes t.tomes)
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +arms-in-chapter: returns an overview of the arms in a specific chapter
|
2022-03-30 22:36:30 +03:00
|
|
|
++ arms-in-chapter
|
2022-06-09 22:19:39 +03:00
|
|
|
|= [sut=type con=coil name=tape]
|
2022-03-30 22:36:30 +03:00
|
|
|
^- overview
|
2022-06-09 22:19:39 +03:00
|
|
|
=/ tom=tome (~(got by q.r.con) (crip name))
|
|
|
|
(sort-overview (arms-as-overview q.tom sut))
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +sort-overview: sort items in an overview in alphabetical order
|
2022-03-30 22:36:30 +03:00
|
|
|
++ sort-overview
|
|
|
|
|= ovr=overview
|
|
|
|
^- overview
|
|
|
|
%+ sort ovr
|
2022-03-31 21:39:09 +03:00
|
|
|
|= [lhs=overview-item rhs=overview-item]
|
|
|
|
(aor (get-overview-name lhs) (get-overview-name rhs))
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +get-overview-name: returns the name of an overview
|
2022-03-30 22:36:30 +03:00
|
|
|
++ get-overview-name
|
|
|
|
|= ovr=overview-item
|
|
|
|
?- ovr
|
|
|
|
[%header *] ""
|
|
|
|
[%item *] name.ovr
|
|
|
|
==
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +arms-as-overview: translate a tome into an overview
|
2022-03-30 22:36:30 +03:00
|
|
|
++ arms-as-overview
|
|
|
|
|= [a=(map term hoon) sut=type]
|
|
|
|
^- overview
|
2022-03-31 21:39:09 +03:00
|
|
|
%+ turn ~(tap by a)
|
|
|
|
|= ar=(pair term hoon)
|
2022-04-05 22:17:57 +03:00
|
|
|
=+ [adoc pdoc cdoc]=(all-arm-docs q.ar sut (trip p.ar))
|
2022-06-30 23:27:06 +03:00
|
|
|
[%item (weld "+" (trip p.ar)) adoc]
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +item-as-overview: changes an item into an overview
|
2022-03-31 21:39:09 +03:00
|
|
|
++ item-as-overview
|
|
|
|
|= uit=(unit item)
|
2022-06-30 23:27:06 +03:00
|
|
|
~? >> debug %item-as-overview
|
2022-03-31 21:39:09 +03:00
|
|
|
^- overview
|
|
|
|
?~ uit ~
|
|
|
|
=+ itm=(need uit)
|
|
|
|
?- itm
|
|
|
|
[%view *] items.itm
|
|
|
|
::
|
|
|
|
[%core *]
|
|
|
|
?~ name.itm
|
|
|
|
(item-as-overview children.itm)
|
2022-07-06 23:21:13 +03:00
|
|
|
:- [%item (weld "^" name.itm) docs.itm]
|
2022-03-31 21:39:09 +03:00
|
|
|
(item-as-overview children.itm)
|
|
|
|
::
|
|
|
|
[%arm *]
|
2022-06-30 23:27:06 +03:00
|
|
|
[%item (weld "+" name.itm) adoc.itm]~
|
2022-03-31 21:39:09 +03:00
|
|
|
::
|
|
|
|
[%chapter *]
|
2022-06-30 23:27:06 +03:00
|
|
|
[%item (weld "|" name.itm) docs.itm]~
|
2022-03-31 21:39:09 +03:00
|
|
|
::
|
|
|
|
[%face *]
|
|
|
|
?~ name.itm
|
|
|
|
~
|
2022-06-30 23:27:06 +03:00
|
|
|
[%item (weld "." name.itm) docs.itm]~
|
2022-03-31 21:39:09 +03:00
|
|
|
==
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +join-items: combines two (unit items) together
|
2022-03-31 21:39:09 +03:00
|
|
|
++ join-items
|
|
|
|
|= [lhs=(unit item) rhs=(unit item)]
|
|
|
|
^- (unit item)
|
|
|
|
?~ lhs rhs
|
|
|
|
?~ rhs lhs
|
|
|
|
`[%view (weld (item-as-overview lhs) (item-as-overview rhs))]
|
2022-04-05 22:17:57 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: contains arms using for printing doccords items
|
2022-04-04 23:23:27 +03:00
|
|
|
+| %printing
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-item: prints a doccords item
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-item
|
|
|
|
|= =item
|
2022-04-07 20:05:58 +03:00
|
|
|
~? >> debug %print-item
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-03-30 22:36:30 +03:00
|
|
|
?- item
|
2022-06-30 22:14:56 +03:00
|
|
|
[%view *] (print-overview items.item *(pair styl styl))
|
2022-03-30 22:36:30 +03:00
|
|
|
[%core *] (print-core +.item)
|
|
|
|
[%arm *] (print-arm +.item)
|
|
|
|
[%chapter *] (print-chapter +.item)
|
|
|
|
[%face *] (print-face +.item)
|
|
|
|
==
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-core: renders documentation for a full core
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-core
|
|
|
|
|= [name=tape docs=what sut=type con=coil uit=(unit item)]
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-04-01 00:35:50 +03:00
|
|
|
=+ [arms chapters]=(arm-and-chapter-overviews sut con name)
|
2022-06-30 22:14:56 +03:00
|
|
|
=/ styles=(pair styl styl) [[`%br ~ `%b] [`%br ~ `%m]]
|
2022-04-01 00:35:50 +03:00
|
|
|
;: weld
|
2022-07-06 23:21:13 +03:00
|
|
|
(print-header (weld "^" name) docs)
|
2022-04-01 00:35:50 +03:00
|
|
|
::
|
|
|
|
?~ arms
|
|
|
|
~
|
2022-06-30 22:14:56 +03:00
|
|
|
(print-overview [%header `['arms:' ~] arms]~ styles)
|
2022-04-01 00:35:50 +03:00
|
|
|
::
|
|
|
|
?~ chapters
|
|
|
|
~
|
2022-06-30 22:14:56 +03:00
|
|
|
(print-overview [%header `['chapters:' ~] chapters]~ styles)
|
2022-04-01 00:35:50 +03:00
|
|
|
::
|
|
|
|
=+ compiled=(item-as-overview uit)
|
|
|
|
?~ compiled
|
|
|
|
~
|
2022-06-30 22:14:56 +03:00
|
|
|
(print-overview [%header `['compiled against: ' ~] compiled]~ styles)
|
2022-04-01 00:35:50 +03:00
|
|
|
==
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-chapter: renders documentation for a single chapter
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-chapter
|
2022-06-09 22:19:39 +03:00
|
|
|
|= [name=tape doc=what sut=type con=coil]
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-04-07 19:55:30 +03:00
|
|
|
~? > debug %print-chapter
|
2022-06-30 22:14:56 +03:00
|
|
|
=/ styles=(pair styl styl) [[`%br ~ `%b] [`%br ~ `%m]]
|
2022-03-30 22:36:30 +03:00
|
|
|
;: weld
|
2022-06-30 23:27:06 +03:00
|
|
|
(print-header (weld "|" name) doc)
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
2022-06-09 22:19:39 +03:00
|
|
|
=+ arms=(arms-in-chapter sut con name)
|
2022-03-30 22:36:30 +03:00
|
|
|
?~ arms
|
|
|
|
~
|
2022-06-30 22:14:56 +03:00
|
|
|
(print-overview [%header `['arms:' ~] arms]~ styles)
|
2022-03-30 22:36:30 +03:00
|
|
|
==
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-arm: renders documentation for a single arm in a core
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-arm
|
2022-04-05 22:52:35 +03:00
|
|
|
|= [name=tape adoc=what pdoc=what cdoc=what gen=hoon sut=type]
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-03-31 21:39:09 +03:00
|
|
|
~? >> debug %print-arm
|
2022-04-01 00:59:45 +03:00
|
|
|
;: weld
|
2022-06-30 23:27:06 +03:00
|
|
|
(print-header (weld "+" name) adoc)
|
|
|
|
[%txt ""]~
|
2022-06-30 22:14:56 +03:00
|
|
|
(styled [[`%br ~ `%b] 'product:']~)
|
|
|
|
(print-header "" pdoc)
|
2022-06-30 23:27:06 +03:00
|
|
|
[%txt ""]~
|
2022-06-30 22:14:56 +03:00
|
|
|
(styled [[`%br ~ `%b] 'default arm in core:']~)
|
|
|
|
(print-header "" cdoc)
|
2022-04-01 00:59:45 +03:00
|
|
|
==
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-face: renders documentation for a face
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-face
|
|
|
|
|= [name=tape doc=what children=(unit item)]
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-04-07 20:05:58 +03:00
|
|
|
~? >> debug %print-face
|
2022-06-30 22:14:56 +03:00
|
|
|
;: weld
|
2022-06-30 23:27:06 +03:00
|
|
|
(print-header (weld "." name) doc)
|
|
|
|
[%txt ""]~
|
2022-03-30 22:36:30 +03:00
|
|
|
?~ children
|
|
|
|
~
|
2022-06-30 22:14:56 +03:00
|
|
|
(print-item u.children)
|
|
|
|
==
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-header: prints name and docs only
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-header
|
|
|
|
|= [name=tape doc=what]
|
2022-06-30 22:14:56 +03:00
|
|
|
^- (list sole-effect)
|
2022-04-07 20:05:58 +03:00
|
|
|
~? >> debug %print-header
|
2022-06-30 22:14:56 +03:00
|
|
|
;: weld
|
|
|
|
(styled [[`%br ~ `%g] (crip name)]~)
|
2022-03-30 22:36:30 +03:00
|
|
|
?~ doc
|
2022-06-30 22:14:56 +03:00
|
|
|
(styled [[`%br ~ `%r] '(undocumented)']~)
|
|
|
|
:~ :- %tan
|
2022-06-30 23:27:06 +03:00
|
|
|
%- flop
|
2022-06-30 22:14:56 +03:00
|
|
|
;: weld
|
|
|
|
[%leaf "{(trip p.u.doc)}"]~
|
|
|
|
(print-sections q.u.doc)
|
|
|
|
== ==
|
|
|
|
==
|
2022-03-30 22:36:30 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-overview: prints summaries of several items
|
|
|
|
::
|
|
|
|
:: the (list styl) provides styles for each generation of child
|
|
|
|
:: items
|
2022-03-30 22:36:30 +03:00
|
|
|
++ print-overview
|
2022-06-30 22:14:56 +03:00
|
|
|
|= [=overview styles=(pair styl styl)]
|
2022-04-07 20:05:58 +03:00
|
|
|
~? >> debug %print-overview
|
2022-06-30 18:39:06 +03:00
|
|
|
=| out=(list sole-effect)
|
|
|
|
|- ^- (list sole-effect)
|
2022-04-01 01:45:28 +03:00
|
|
|
?~ overview out
|
|
|
|
=/ oitem i.overview
|
|
|
|
?- oitem
|
|
|
|
[%header *]
|
|
|
|
%= $
|
|
|
|
overview t.overview
|
|
|
|
out ;: weld
|
|
|
|
out
|
|
|
|
?~ doc.oitem ~
|
2022-06-30 22:14:56 +03:00
|
|
|
(styled [p.styles (crip "{(trip p.u.doc.oitem)}")]~)
|
|
|
|
^$(overview children.oitem)
|
|
|
|
==
|
2022-04-01 01:45:28 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
[%item *]
|
|
|
|
%= $
|
|
|
|
overview t.overview
|
|
|
|
out ;: weld
|
|
|
|
out
|
2022-06-30 22:14:56 +03:00
|
|
|
(styled [q.styles (crip name.oitem)]~)
|
|
|
|
?~ doc.oitem
|
|
|
|
%- styled
|
|
|
|
:~ [[`%br ~ `%r] '(undocumented)']
|
|
|
|
[[~ ~ ~] '']
|
|
|
|
==
|
|
|
|
^- (list sole-effect)
|
|
|
|
[%tan [[%leaf ""] [%leaf "{(trip p.u.doc.oitem)}"] ~]]~
|
2022-04-01 01:45:28 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
==
|
2022-03-30 21:51:40 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-sections: renders a list of sections as tang
|
|
|
|
::
|
|
|
|
:: prints the longform documentation
|
2022-03-30 21:51:40 +03:00
|
|
|
++ print-sections
|
|
|
|
|= sections=(list sect)
|
|
|
|
^- tang
|
|
|
|
=| out=tang
|
|
|
|
|-
|
|
|
|
?~ sections out
|
|
|
|
=. out
|
|
|
|
;: weld
|
|
|
|
out
|
|
|
|
`tang`[%leaf ""]~
|
|
|
|
(print-section i.sections)
|
|
|
|
==
|
|
|
|
$(sections t.sections)
|
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +print-section: renders a sect as a tang
|
2022-03-30 21:51:40 +03:00
|
|
|
++ print-section
|
|
|
|
|= section=sect
|
|
|
|
^- tang
|
|
|
|
%+ turn section
|
|
|
|
|= =pica
|
|
|
|
^- tank
|
|
|
|
?: p.pica
|
|
|
|
[%leaf (trip q.pica)]
|
|
|
|
[%leaf " {(trip q.pica)}"]
|
2022-06-30 22:14:56 +03:00
|
|
|
::
|
hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.
in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.
if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.
there are a few other changes:
+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.
similarly for commenting out the %note case in +open:ap - this was an
earlier mistake
postfix comments for chapters are now enabled.
+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.
arms that handle batch comments (+glow and +whap) were refactored
+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.
some parsers built with |@ were rewritten to use |*
|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-07-19 21:57:36 +03:00
|
|
|
:: +styled: makes $sole-effects out of $styls and $cords
|
2022-06-30 22:14:56 +03:00
|
|
|
++ styled
|
|
|
|
|= [in=(list (pair styl cord))]
|
|
|
|
^- (list sole-effect)
|
|
|
|
=| out=(list sole-effect)
|
|
|
|
|-
|
|
|
|
?~ in out
|
|
|
|
=/ eff=styx [p.i.in [q.i.in]~]~
|
|
|
|
%= $
|
|
|
|
in t.in
|
|
|
|
out (snoc out [%klr eff])
|
|
|
|
==
|
2022-03-30 21:51:40 +03:00
|
|
|
--
|