Remove indirect hoons and fix up callsites using //

This commit is contained in:
Elliot Glaysher 2018-06-26 13:52:41 -07:00
parent 693ab11c65
commit 87cbea377d
8 changed files with 435 additions and 374 deletions

View File

@ -23,7 +23,72 @@
::::
/= rfctext /: /%/rfc /txt/
::
// /%/split
|%
:: Splits a path into the endpoint prefix and the remainder,
:: which is assumed to be a path within the JSON object. We
:: choose the longest legal endpoint prefix.
::
++ split
|= pax/path
:: =- ~& [%pax pax - (valid-endpoint pax)] -
=+ l=(lent pax)
|- ^- {path path}
?: ?=(valid-get-endpoint (scag l pax))
[(scag l pax) (slag l pax)]
?~ l
~& %bad-endpoint
~|(%bad-endpoint !!)
$(l (dec l))
::
:: These are all the github GET endpoints, sorted with
:: `env LC_ALL=C sort`
::
:: end-points include required query parameters
++ valid-get-endpoint
$? {$drafts id/@t $~}
{$drafts $~}
{$history $~}
{$labels id/@t $~}
{$labels $~}
{$messages id/@t $attachments id/@t $~}
{$messages id/@t $~}
{$messages $~}
{$profile $~}
{$threads id/@t $~}
{$threads $~}
==
++ vaild-post-endpoint
$? {$drafts $send $~}
{$drafts $~}
{$messages id/@t $modify $~}
{$messages id/@t $trash $~}
{$messages id/@t $untrash $~}
{$messages $import $~}
{$messages $send $~}
{$messages $~}
{$labels $~}
{$threads id/@t $trash $~}
{$threads id/@t $untrash $~}
{$threads id/@t $modify}
{$stop $~}
{$watch $~}
==
++ valid-delete-endpoint
$? {$drafts id/@t $~}
{$labels id/@t $~}
{$messages id/@t $~}
{$thread id/@t $~}
==
++ valid-put-endpoint
$? {$drafts id/@t $~}
{$labels id/@t $~}
==
++ valid-patch-endpoint
$? {$labels id/@t $~}
==
--
::/- gmail
:: /ape/gh/split.hoon defines ++split, which splits a request
:: at the end of the longest possible endpoint.

View File

@ -1,70 +0,0 @@
::
|%
:: Splits a path into the endpoint prefix and the remainder,
:: which is assumed to be a path within the JSON object. We
:: choose the longest legal endpoint prefix.
::
++ split
|= pax/path
:: =- ~& [%pax pax - (valid-endpoint pax)] -
=+ l=(lent pax)
|- ^- {path path}
?: ?=(valid-get-endpoint (scag l pax))
[(scag l pax) (slag l pax)]
?~ l
~& %bad-endpoint
~|(%bad-endpoint !!)
$(l (dec l))
::
:: These are all the github GET endpoints, sorted with
:: `env LC_ALL=C sort`
::
:: end-points include required query parameters
++ valid-get-endpoint
$? {$drafts id/@t $~}
{$drafts $~}
{$history $~}
{$labels id/@t $~}
{$labels $~}
{$messages id/@t $attachments id/@t $~}
{$messages id/@t $~}
{$messages $~}
{$profile $~}
{$threads id/@t $~}
{$threads $~}
==
++ vaild-post-endpoint
$? {$drafts $send $~}
{$drafts $~}
{$messages id/@t $modify $~}
{$messages id/@t $trash $~}
{$messages id/@t $untrash $~}
{$messages $import $~}
{$messages $send $~}
{$messages $~}
{$labels $~}
{$threads id/@t $trash $~}
{$threads id/@t $untrash $~}
{$threads id/@t $modify}
{$stop $~}
{$watch $~}
==
++ valid-delete-endpoint
$? {$drafts id/@t $~}
{$labels id/@t $~}
{$messages id/@t $~}
{$thread id/@t $~}
==
++ valid-put-endpoint
$? {$drafts id/@t $~}
{$labels id/@t $~}
==
++ valid-patch-endpoint
$? {$labels id/@t $~}
==
--
::

File diff suppressed because it is too large Load Diff

View File

@ -2,13 +2,10 @@
:::: /hoon/down-jet/lib
::
/? 310
/- markdown
/+ *down-jet-parse, *down-jet-rend
::
::::
::
=,(^?(markdown) .)
// /%/parse :: inli donp parse
// /%/rend :: sing sung sang flat into-inner
~% %down ..is ~
|%
++ mark

View File

@ -3,6 +3,7 @@
:::: /hoon/parse/down-jet/lib
::
/? 310
/- *markdown
=, html
=, format
=+ =~

View File

@ -3,6 +3,10 @@
:::: /hoon/rend/down-jet/lib
::
/? 310
/- *markdown
::
=, format
=, html
::
|%
++ into-inner

View File

@ -3,4 +3,8 @@
::
/? 310
::
// /===/mar/xml :: alias
:: alias
/: /===/mar/xml
/!noun/
::
-

View File

@ -732,7 +732,7 @@
=/ hoon-parser (vang & (en-beam src-beam))
|^ ::
%+ cook
|= a=[@ud (list ^cable) (list ^cable) (list ^crane) (list ^brick)]
|= a=[@ud (list ^cable) (list ^cable) (list ^crane) (list hoon)]
^- scaffold
[[[p q] s]:src-beam a]
::
@ -757,10 +757,9 @@
(easy ~)
==
::
:: todo: the rest of the horns
(star ;~(sfix crane gap))
::
(most gap brick)
(most gap tall:hoon-parser)
==
:: +beam: parses a hood path and converts it to a beam
::
@ -770,13 +769,6 @@
fas
(sear plex (stag %clsg poor)):hoon-parser
==
:: +brick: parses a +^brick, a direct or indirect piece of hoon code
::
++ brick
;~ pose
(stag %indirect ;~(pfix fas fas gap beam))
(stag %direct tall:hoon-parser)
==
:: +cable: parses a +^cable, a reference to something on the filesystem
::
:: This parses:
@ -3489,7 +3481,6 @@
|= [path-to-render=rail query-string=coin =scaffold]
^- build-receipt
:: TODO: support query-string
:: TODO: support indirect hoons
::
:: blocks: accumulator for blocked sub-builds
::
@ -3554,7 +3545,7 @@
[build [%blocks builds.crane-result ~] accessed-builds]
:: combined-hoon: source hoons condensed into a single +hoon
::
=/ combined-hoon=hoon (stack-sources sources.scaffold)
=/ combined-hoon=hoon [%tssg sources.scaffold]
:: compile :combined-hoon against :subject
::
=/ compile=^build
@ -4170,19 +4161,6 @@
[[%face face.cable.i.imports p.i.core-vases] q.i.core-vases]
::
$(core-vases t.core-vases, imports t.imports)
:: +stack-sources: combine bricks into one +hoon: =~(hoon1 hoon2 ...)
::
++ stack-sources
|= sources=(list brick)
^- hoon
::
=- [%tssg -]
%+ turn sources
|= =brick
^- hoon
::
?> ?=(%direct -.brick)
source.brick
--
::
++ make-reef