mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
Merge branch 'master' of http://github.com/urbit/arvo
This commit is contained in:
commit
b19ba4df49
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Urbit
|
||||
Copyright (c) 2017 Urbit
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
@ -128,7 +128,7 @@
|
||||
|= {gol/goal mod/dojo-model} ^- dojo-command
|
||||
[[%poke gol] [0 [%ge mod(q.p [q.gol q.p.mod])]]]
|
||||
::
|
||||
++ dp-command-line ;~(sfix dp-command (just '\0a'))
|
||||
++ dp-command-line ;~(sfix dp-command (star ace) (just '\0a'))
|
||||
++ dp-variable :: %verb or %brev
|
||||
|* {sym/rule src/rule}
|
||||
%+ cook
|
||||
@ -271,9 +271,9 @@
|
||||
==
|
||||
++ dp-value :: ++dojo-source
|
||||
;~ pose
|
||||
(stag %sa ;~(pfix tar pam sym))
|
||||
(stag %ex dp-twig)
|
||||
(stag %tu (ifix [sel ser] (most ace dp-source)))
|
||||
(stag %sa ;~(pfix tar pam sym))
|
||||
==
|
||||
::
|
||||
++ dp-config :: ++dojo-config
|
||||
|
@ -158,6 +158,7 @@
|
||||
++ poke-kiln-sync (wrap poke-sync):from-kiln
|
||||
++ poke-kiln-syncs (wrap poke-syncs):from-kiln
|
||||
++ poke-kiln-start-autoload (wrap poke-start-autoload):from-kiln
|
||||
++ poke-kiln-wipe-ford (wrap poke-wipe-ford):from-kiln
|
||||
++ poke-kiln-autoload (wrap poke-autoload):from-kiln
|
||||
++ poke-kiln-overload (wrap poke-overload):from-kiln
|
||||
++ poke-kiln-unmount (wrap poke-unmount):from-kiln
|
||||
|
@ -1693,6 +1693,7 @@
|
||||
::
|
||||
++ pa-report-group :: update presence
|
||||
|= vew/(set bone)
|
||||
?: [no-presence=&] +>.$
|
||||
%^ pa-report vew %group
|
||||
:- %- ~(run by locals)
|
||||
|=({@ a/status} a)
|
||||
@ -1936,7 +1937,18 @@
|
||||
++ pa-revise :: revise existing
|
||||
|= {num/@ud gam/telegram}
|
||||
=+ way=(sub count num)
|
||||
?: =(gam (snag (dec way) grams))
|
||||
=/ ole (snag (dec way) grams)
|
||||
=. q.q.gam
|
||||
::REVIEW let old %received override different "new" states, in an
|
||||
:: attempt to stem a stale-update loop
|
||||
::
|
||||
%- ~(urn by q.q.gam)
|
||||
|= {a/partner b/{envelope dev/delivery}} ^- {envelope delivery}
|
||||
?: ?=({$~ ^ $received} (~(get by q.q.ole) a))
|
||||
b(dev %received)
|
||||
b
|
||||
::
|
||||
?: =(gam ole)
|
||||
+>.$ :: no change
|
||||
=. grams (welp (scag (dec way) grams) [gam (slag way grams)])
|
||||
(pa-refresh num gam)
|
||||
|
59
gen/cram.hoon
Normal file
59
gen/cram.hoon
Normal file
@ -0,0 +1,59 @@
|
||||
::
|
||||
:::: hoon/cram/gen
|
||||
::
|
||||
:: test generator for the cram markdown syntax
|
||||
::
|
||||
:: todo: integrate with ++sail and embed in hoon compiler
|
||||
::
|
||||
:: ++cram is a simple markdown-inspired parser that makes
|
||||
:: common html tropes easy to type. you can think of ++cram
|
||||
:: as "rational markdown" or "markdown with syntax errors."
|
||||
:: a document format should be easy to type and read, but
|
||||
:: that doesn't mean it can't or have rigorous syntax.
|
||||
::
|
||||
:: tldr: ++cram is indent-oriented. indent 2 spaces for
|
||||
:: a dynamic interpolation, 4 spaces for example code, 6
|
||||
:: spaces for a blockquote and 8 spaces for verse. separate
|
||||
:: every semantic block by a blank line. use - for
|
||||
:: unordered lists, + for ordered lists.
|
||||
::
|
||||
:: markdown link syntax works. * means bold, _ means
|
||||
:: italics, "" inserts smart quotes. all enclosed
|
||||
:: strings are reparsed; escape the terminator within
|
||||
:: the string, eg, *star \* in bold text*.
|
||||
::
|
||||
:: markdown `literal` syntax is supported, but all hoon
|
||||
:: constants are automatically marked as code. also, any
|
||||
:: hoon expression prefixed with # is a code literal.
|
||||
::
|
||||
:: (++cram is a valid hoon parsing rule, but it does a lot
|
||||
:: of custom processing internally, since the language is
|
||||
:: context-sensitive. we use a context-sensitive parser
|
||||
:: to cut the lines into blocks, then reparse flow blocks
|
||||
:: with normal hoon rules. multipass parsing is the tax
|
||||
:: humans have to pay for simple but human-friendly syntax.)
|
||||
::
|
||||
::|= inp/cord
|
||||
::=< (steam-marl (rash inp apex:(sail &)))
|
||||
=< |=(pax/path (test pax))
|
||||
|% ::
|
||||
++ test :: test text parsing
|
||||
|= pax/path
|
||||
^- tape
|
||||
::
|
||||
:: src: text file as (list cord)
|
||||
:: txt: source as tape with newlines
|
||||
:: vex: parsing result
|
||||
::
|
||||
=/ src .^(wain %cx pax)
|
||||
=. src ['---' src]
|
||||
=/ txt (zing (turn src |=(@t (weld (rip 3 +<) `tape`~[`@`10]))))
|
||||
=/ vex (cram:vast [1 1] txt)
|
||||
::
|
||||
:: print result as error or xml text
|
||||
?~ q.vex
|
||||
"syntax error: line {(scow %ud p.p.vex)}, column {(scow %ud q.p.vex)}"
|
||||
?: [freeze=|] (poxo (snag 1 ~(shut ap p.u.q.vex)))
|
||||
(poxo ;;(manx q:(slap !>(..zuse) p.u.q.vex)))
|
||||
::
|
||||
--
|
@ -101,7 +101,7 @@
|
||||
:> we decorate the mold rather than the arm. the compiler
|
||||
:> will copy the mold decoration onto the arm.
|
||||
+|
|
||||
+= spot {p/@ q/@} :< a coordinate
|
||||
+= spot [p=@ q=@] :< a coordinate
|
||||
+= tops :> also a coordinate
|
||||
{p/@ q/@}
|
||||
+= goof :> a simple tuple
|
||||
|
13
gen/hood/wipe-ford.hoon
Normal file
13
gen/hood/wipe-ford.hoon
Normal file
@ -0,0 +1,13 @@
|
||||
:: Kiln: wipe ford cache
|
||||
::
|
||||
:::: /hoon/wipe-ford/hood/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{arg/$~ $~}
|
||||
==
|
||||
[%kiln-wipe-ford ~]
|
@ -3,18 +3,35 @@
|
||||
:::: /hoon/moon/gen
|
||||
::
|
||||
/? 310
|
||||
/- sole
|
||||
[. sole]
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
:- %ask
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
$~
|
||||
$~
|
||||
==
|
||||
:- %tang :_ ~ :- %leaf
|
||||
=+ ran=(clan p.bec)
|
||||
=/ ran (clan p.bec)
|
||||
?: ?=({?($earl $pawn)} ran)
|
||||
"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=+ tic=.^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
|
||||
"moon: {<`@p`mon>}; ticket: {<`@p`tic>}"
|
||||
%- sole-so
|
||||
:- %tang :_ ~
|
||||
leaf+"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
|
||||
=/ mon (mix (lsh 5 1 (end 5 1 eny)) p.bec)
|
||||
=/ tic .^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
|
||||
%+ sole-yo
|
||||
leaf+"(see https://github.com/urbit/arvo/issues/327 for details)"
|
||||
%+ sole-yo
|
||||
:- %leaf
|
||||
;: weld
|
||||
"WARNING: linking a moon to your "
|
||||
?-(ran $czar "galaxy", $king "star", $duke "planet")
|
||||
" can cause networking bugs"
|
||||
==
|
||||
%+ sole-lo
|
||||
[& %$ "enter y/yes to continue: "]
|
||||
|= inp/tape
|
||||
?. |(=("y" inp) =("yes" inp))
|
||||
(sole-so [%tang leaf+"canceled" ~])
|
||||
(sole-so [%tang leaf+"moon: {<`@p`mon>}; ticket: {<`@p`tic>}" leaf+"" ~])
|
||||
|
@ -11,4 +11,6 @@
|
||||
{{her/@p $~} $~}
|
||||
==
|
||||
:- %noun
|
||||
~_ leaf+"can't ticket {<her>} (not a child of {<p.bec>})"
|
||||
?> =(p.bec (sein:title her))
|
||||
.^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her))
|
||||
|
@ -11,4 +11,5 @@
|
||||
==
|
||||
:- %womb-balance-all
|
||||
=+ [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now)]
|
||||
.^((set {passhash mail}):womb %gx /[him]/hood/[cas]/womb/balance/womb-balance-all)
|
||||
=/ balances =>(womb ,(set [passhash mail]))
|
||||
.^(balances %gx /[him]/hood/[cas]/womb/balance/womb-balance-all)
|
||||
|
@ -260,6 +260,8 @@
|
||||
|= tym/@dr
|
||||
abet:(emit %wait /kiln/overload/(scot %dr tym) (add ~s10 now))
|
||||
::
|
||||
++ poke-wipe-ford |=($~ abet:(emit %wipe /kiln our ~))
|
||||
::
|
||||
++ take |=(way/wire ?>(?=({@ $~} way) (work i.way))) :: general handler
|
||||
++ take-mere ::
|
||||
|= {way/wire are/(each (set path) (pair term tang))}
|
||||
|
@ -284,4 +284,7 @@
|
||||
++ kiss-arvo task-arvo :: in request ->$
|
||||
++ note-arvo note-arvo :: out request $->
|
||||
++ sign-arvo sign-arvo :: in result $<-
|
||||
++ nule nule:unix:userlib :: lines to unix cord
|
||||
++ lore to-wain:format :: atom to line list
|
||||
++ role of-wain:format :: line list to atom
|
||||
--
|
||||
|
1823
lib/vast2.hoon
Normal file
1823
lib/vast2.hoon
Normal file
File diff suppressed because it is too large
Load Diff
11
mar/noun.hoon
Normal file
11
mar/noun.hoon
Normal file
@ -0,0 +1,11 @@
|
||||
::
|
||||
:::: /hoon/noun/mar
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
:::: A minimal noun mark
|
||||
|_ non/*
|
||||
++ grab |%
|
||||
++ noun *
|
||||
--
|
||||
--
|
@ -44,7 +44,8 @@
|
||||
(malt (turn t.t.a |=(b/cord (rash b account))))
|
||||
::
|
||||
++ user ;~(pfix (jest 'User ') (cook crip (star prn)))
|
||||
++ knot (sear (flit |=(a/^knot !=('' a))) urs:ab)
|
||||
++ knot %+ cook crip
|
||||
(plus ;~(pose nud low hig hep dot sig cab))
|
||||
++ location ;~(pfix (jest 'Location ') (cook crip (star prn)))
|
||||
++ account
|
||||
;~ plug
|
||||
|
24
mar/umd.hoon
Normal file
24
mar/umd.hoon
Normal file
@ -0,0 +1,24 @@
|
||||
::
|
||||
:::: /hoon/umd/mar
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
|_ mud/@t
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/x-unmark (taco mud)]
|
||||
++ txt
|
||||
(lore mud)
|
||||
++ elem
|
||||
^- manx
|
||||
[/div ~(shut ap %xml (rash mud fenced:cram:vast))]
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime |=({p/mite q/octs} q.q)
|
||||
++ noun @t
|
||||
++ txt role
|
||||
--
|
||||
++ grad %txt
|
||||
++ garb /down
|
||||
--
|
@ -8,8 +8,18 @@
|
||||
==
|
||||
=, format
|
||||
=, html
|
||||
::
|
||||
|%
|
||||
++ script-safe
|
||||
!.
|
||||
|= a/tape ^- tape
|
||||
?~ a a
|
||||
?. ?=({$'<' $'/' *} a) [i.a $(a t.a)]
|
||||
['<' '\\' '/' $(a t.t.a)]
|
||||
--
|
||||
::
|
||||
^- marl
|
||||
=/ tree (en-json (pairs:enjs data+dat sein+dat-sen ~))
|
||||
=/ tree (script-safe (en-json (pairs:enjs data+dat sein+dat-sen ~)))
|
||||
;= ;script(type "text/javascript"): window.tree = {tree}
|
||||
;div#tree;
|
||||
==
|
||||
|
@ -498,7 +498,7 @@
|
||||
++ peek :: external inspect
|
||||
|= {now/@da hap/path}
|
||||
^- (unit)
|
||||
?~ hap [~ hoon]
|
||||
?~ hap [~ hoon-version]
|
||||
=+ rob=((sloy ~(beck (is vil eny mast niz) now)) [151 %noun] hap)
|
||||
?~ rob ~
|
||||
?~ u.rob ~
|
||||
@ -573,7 +573,7 @@
|
||||
::
|
||||
:: find the hoon version number of the new kernel
|
||||
::
|
||||
=+ nex=(@ .*(cop q:(~(mint ut p.raw) %noun [%limb %hoon])))
|
||||
=+ nex=(@ .*(cop q:(~(mint ut p.raw) %noun [%limb %hoon-version])))
|
||||
?> |(=(nex hoon) =(+(nex) hoon))
|
||||
::
|
||||
:: if we're upgrading language versions, recompile the compiler
|
||||
|
694
sys/hoon.hoon
694
sys/hoon.hoon
@ -7,8 +7,9 @@
|
||||
:::: 0: version stub ::
|
||||
:: ::
|
||||
~% %k.143 ~ ~ ::
|
||||
!:
|
||||
|%
|
||||
++ hoon +
|
||||
++ hoon-version +
|
||||
-- =>
|
||||
:: ::
|
||||
:::: 1: layer one ::
|
||||
@ -6816,8 +6817,8 @@
|
||||
::
|
||||
{$zpwt *}
|
||||
?: ?: ?=(@ p.gen)
|
||||
(lte hoon p.gen)
|
||||
&((lte hoon p.p.gen) (gte hoon q.p.gen))
|
||||
(lte hoon-version p.gen)
|
||||
&((lte hoon-version p.p.gen) (gte hoon-version q.p.gen))
|
||||
q.gen
|
||||
~_(leaf+"hoon-version" !!)
|
||||
::
|
||||
@ -9881,6 +9882,671 @@
|
||||
?~ sim [i.reb $(reb t.reb, sim ~)]
|
||||
[;/((flop sim)) i.reb $(reb t.reb, sim ~)]
|
||||
--
|
||||
::
|
||||
++ cram :: parse unmark
|
||||
=> |%
|
||||
++ item (pair mite marl:twig) :: xml node generator
|
||||
++ colm @ud :: column
|
||||
++ flow marl:twig :: node or generator
|
||||
++ mite :: context
|
||||
$? $down :: outer embed
|
||||
$rule :: horizontal ruler
|
||||
$list :: unordered list
|
||||
$lime :: list item
|
||||
$lord :: ordered list
|
||||
$poem :: verse
|
||||
$bloc :: blockquote
|
||||
$code :: preformatted code
|
||||
$head :: heading
|
||||
$expr :: dynamic expression
|
||||
== ::
|
||||
++ trig :: line style
|
||||
$: col/@ud :: start column
|
||||
sty/trig-style :: style
|
||||
== ::
|
||||
++ trig-style :: type of parsed line
|
||||
$? $done :: end of input
|
||||
$rule :: --- horizontal ruler
|
||||
$lint :: + line item
|
||||
$lite :: - line item
|
||||
$head :: # heading
|
||||
$bloc :: > block-quote
|
||||
$expr :: ;sail expression
|
||||
$text :: anything else
|
||||
== ::
|
||||
++ graf :: paragraph element
|
||||
$% {$bold p/(list graf)} :: *bold*
|
||||
{$talc p/(list graf)} :: _italics_
|
||||
{$quod p/(list graf)} :: "double quote"
|
||||
{$code p/tape} :: code literal
|
||||
{$text p/tape} :: text symbol
|
||||
{$link p/(list graf) q/tape} :: URL
|
||||
{$expr p/tuna:twig} :: interpolated hoon
|
||||
==
|
||||
--
|
||||
=< apex
|
||||
|%
|
||||
++ apex
|
||||
=; fel |=(nail (fel +<))
|
||||
:(stag %xray [%div ~] fenced)
|
||||
::
|
||||
++ fenced
|
||||
::
|
||||
:: top: original indentation level
|
||||
::
|
||||
|= {{@u top/@u} tape}
|
||||
%+ pfix (hrul:parse +<)
|
||||
|= nail ^- (like marl:twig)
|
||||
~($ main top +<)
|
||||
::
|
||||
++ main
|
||||
::
|
||||
:: state of the parsing loop. we maintain a construction
|
||||
:: stack for elements and a line stack for lines in the
|
||||
:: current block. a blank line causes the current block
|
||||
:: to be parsed and thrown in the current element. when
|
||||
:: the indent column retreats, the element stack rolls up.
|
||||
::
|
||||
:: err: error position
|
||||
:: col: current control column
|
||||
:: hac: stack of items under construction
|
||||
:: cur: current item under construction
|
||||
:: lub: current block being read in
|
||||
::
|
||||
=| err/(unit hair)
|
||||
=| col/@ud
|
||||
=| hac/(list item)
|
||||
=/ cur/item [%down ~]
|
||||
=| lub/(unit (pair hair (list tape)))
|
||||
|_ {top/@ud naz/hair los/tape}
|
||||
::
|
||||
++ $ :: resolve
|
||||
^- (like flow)
|
||||
=> line
|
||||
::
|
||||
:: if error position is set, produce error
|
||||
?. =(~ err) [+.err ~]
|
||||
::
|
||||
:: all data was consumed
|
||||
=- [naz `[- [naz los]]]
|
||||
=> made
|
||||
|- ^- flow
|
||||
::
|
||||
:: fold all the way to top
|
||||
?~ hac fine
|
||||
$(..^$ fold)
|
||||
::
|
||||
::+|
|
||||
::
|
||||
++ cur-indent
|
||||
?- p.cur
|
||||
$down 2
|
||||
$rule 0
|
||||
$head 0
|
||||
$expr 2
|
||||
$list 0
|
||||
$lime 2
|
||||
$lord 0
|
||||
$poem 8
|
||||
$code 4
|
||||
$bloc 2
|
||||
==
|
||||
::
|
||||
++ back :: column retreat
|
||||
|= luc/@ud
|
||||
^+ +>
|
||||
?: =(luc col) +>
|
||||
::
|
||||
:: nex: next backward step that terminates this context
|
||||
=/ nex/@ud cur-indent ::REVIEW code and poem blocks are handled elsewhere
|
||||
?: (gth nex (sub col luc))
|
||||
::
|
||||
:: indenting pattern violation
|
||||
::~& indent-pattern-violation+[p.cur nex col luc]
|
||||
..^$(col luc, err `[p.naz luc])
|
||||
=. ..^$ fold
|
||||
$(col (sub col nex))
|
||||
::
|
||||
++ fine :: item to flow
|
||||
^- flow
|
||||
?: ?=(?($down $head $expr) p.cur)
|
||||
(flop q.cur)
|
||||
=- [[- ~] (flop q.cur)]~
|
||||
?- p.cur
|
||||
$rule %hr
|
||||
$list %ul
|
||||
$lord %ol
|
||||
$lime %li
|
||||
$code %pre
|
||||
$poem %div ::REVIEW actual container element?
|
||||
$bloc %blockquote
|
||||
==
|
||||
::
|
||||
++ fold ^+ . :: complete and pop
|
||||
?~ hac .
|
||||
%= .
|
||||
hac t.hac
|
||||
cur [p.i.hac (concat-code (weld fine q.i.hac))]
|
||||
==
|
||||
::
|
||||
++ concat-code :: merge continuous pre
|
||||
|= a/flow
|
||||
?~ a a
|
||||
?. ?=({$pre *} -.i.a) a
|
||||
|-
|
||||
?~ t.a a
|
||||
?. ?=({$pre $~} -.i.t.a) a
|
||||
:: add blank line between blocks
|
||||
$(t.a t.t.a, c.i.a (welp c.i.t.a ;/("\0a") c.i.a))
|
||||
::
|
||||
++ snap :: capture raw line
|
||||
=| nap/tape
|
||||
|- ^+ [nap +>]
|
||||
::
|
||||
:: no unterminated lines
|
||||
?~ los
|
||||
::~& %unterminated-line
|
||||
[~ +>(err `naz)]
|
||||
?. =(`@`10 i.los)
|
||||
?: (gth col q.naz)
|
||||
?. =(' ' i.los)
|
||||
::~& expected-indent+[col naz los]
|
||||
[~ +>(err `naz)]
|
||||
$(los t.los, q.naz +(q.naz))
|
||||
::
|
||||
:: save byte and repeat
|
||||
$(los t.los, q.naz +(q.naz), nap [i.los nap])
|
||||
::
|
||||
:: consume newline
|
||||
:_ +>(los t.los, naz [+(p.naz) 1])
|
||||
::
|
||||
:: trim trailing spaces
|
||||
|- ^- tape
|
||||
?: ?=({$' ' *} nap)
|
||||
$(nap t.nap)
|
||||
(flop nap)
|
||||
::
|
||||
++ skip :: discard line
|
||||
|- ^+ +
|
||||
::
|
||||
:: no unterminated lines
|
||||
?~ los
|
||||
::~& %unterminated-line
|
||||
+(err `naz)
|
||||
?. =(`@`10 i.los)
|
||||
::
|
||||
:: eat byte and repeat
|
||||
$(los t.los)
|
||||
::
|
||||
:: consume newline
|
||||
+(los t.los, naz [+(p.naz) 1])
|
||||
::
|
||||
++ look :: inspect line
|
||||
^- (unit trig)
|
||||
(wonk (look:parse naz los))
|
||||
::
|
||||
++ made :: compose block
|
||||
^+ .
|
||||
::
|
||||
:: empty block, no action
|
||||
?~ lub .
|
||||
::
|
||||
:: if block is preformatted code
|
||||
?: ?=($code p.cur)
|
||||
=- fold(lub ~, q.cur (weld - q.cur), col (sub col 4))
|
||||
%+ turn q.u.lub
|
||||
|= tape ^- mars
|
||||
::
|
||||
:: each line is text data with its newline
|
||||
;/("{+<}\0a")
|
||||
::
|
||||
:: if block is verse
|
||||
?: ?=($poem p.cur)
|
||||
::
|
||||
:: add break between stanzas
|
||||
=. q.cur ?~(q.cur q.cur [[[%br ~] ~] q.cur])
|
||||
=- fold(lub ~, q.cur (weld - q.cur), col (sub col 8))
|
||||
%+ turn q.u.lub
|
||||
|= tape ^- manx
|
||||
::
|
||||
:: each line is a paragraph
|
||||
:- [%p ~]
|
||||
:_ ~
|
||||
;/("{+<}\0a")
|
||||
::
|
||||
:: yex: block recomposed, with newlines
|
||||
=/ yex/tape
|
||||
(zing (turn (flop q.u.lub) |=(a/tape (runt [(dec col) ' '] "{a}\0a"))))
|
||||
::
|
||||
:: vex: parse of paragraph
|
||||
=/ vex/(like marl:twig)
|
||||
::
|
||||
:: either a one-line header or a paragraph
|
||||
%. [p.u.lub yex]
|
||||
%- full
|
||||
?- p.cur
|
||||
$rule =<(;~(pfix (punt whit) hrul) parse)
|
||||
$expr expr:parse
|
||||
$head head:parse
|
||||
@ para:parse
|
||||
==
|
||||
::
|
||||
:: if error, propagate correctly
|
||||
?~ q.vex ..$(err `p.vex)
|
||||
::
|
||||
:: finish tag if it's a header or rule
|
||||
=< ?:(?=(?($head $rule) p.cur) fold ..$)
|
||||
::
|
||||
:: save good result, clear buffer
|
||||
..$(lub ~, q.cur (weld p.u.q.vex q.cur))
|
||||
::
|
||||
++ line ^+ . :: body line loop
|
||||
::
|
||||
=. col ?~(col top col)
|
||||
::
|
||||
:: abort after first error
|
||||
?: !=(~ err) .
|
||||
::
|
||||
:: pic: profile of this line
|
||||
=/ pic look
|
||||
::
|
||||
:: if line is blank
|
||||
?~ pic
|
||||
::
|
||||
:: break section
|
||||
line:made:skip
|
||||
::
|
||||
:: line is not blank
|
||||
=> .(pic u.pic)
|
||||
::
|
||||
:: if end of input, complete
|
||||
?: |(?=($done sty.pic) (lth col.pic top))
|
||||
..$(q.naz col.pic)
|
||||
::
|
||||
:: bal: inspection copy of lub, current section
|
||||
=/ bal lub
|
||||
::
|
||||
:: if within section
|
||||
?~ bal (new-container pic)
|
||||
::
|
||||
:: detect unspaced new containers
|
||||
?: ?& ?=(?($down $lime $bloc) p.cur)
|
||||
|(!=(%text sty.pic) (gth col.pic col))
|
||||
==
|
||||
(new-container:made pic)
|
||||
::
|
||||
:: first line of container is legal
|
||||
?~ q.u.bal
|
||||
=^ nap ..$ snap
|
||||
line(lub bal(q.u [nap q.u.bal]))
|
||||
::
|
||||
:: detect bad block structure
|
||||
?. ?- p.cur
|
||||
::
|
||||
:: can't(/directly) contain text
|
||||
?($lord $list) ~|(bad-leaf-container+p.cur !!)
|
||||
::
|
||||
:: only one line in a header/break
|
||||
?($head $rule) |
|
||||
::
|
||||
:: literals need to end with a blank line
|
||||
?($code $poem $expr) (gte col.pic col)
|
||||
::
|
||||
:: text flows must continue aligned
|
||||
?($down $list $lime $lord $bloc) =(col.pic col)
|
||||
==
|
||||
::~& bad-block-structure+[p.cur col col.pic]
|
||||
..$(err `[p.naz col.pic])
|
||||
::
|
||||
:: accept line and continue
|
||||
=^ nap ..$ snap
|
||||
line(lub bal(q.u [nap q.u.bal]))
|
||||
::
|
||||
++ new-container :: enter list/quote
|
||||
|= pic/trig
|
||||
::
|
||||
:: if column has retreated, adjust stack
|
||||
=. +>.$ ?. (lth col.pic col) +>.$ (back col.pic)
|
||||
::
|
||||
:: dif: columns advanced
|
||||
:: erp: error position
|
||||
::
|
||||
=/ dif (sub col.pic col)
|
||||
=/ erp [p.naz col.pic]
|
||||
=. col col.pic
|
||||
::
|
||||
:: execute appropriate paragraph form
|
||||
=< line:abet:apex
|
||||
|%
|
||||
::
|
||||
++ abet :: accept line
|
||||
::
|
||||
:: nap: take first line
|
||||
..$(lub `[naz ~])
|
||||
::
|
||||
++ apex ^+ . :: by column offset
|
||||
?+ dif fail ::
|
||||
$0 apse :: unindented forms
|
||||
$4 (push %code) :: code literal
|
||||
$8 (push %poem) :: verse literal
|
||||
==
|
||||
::
|
||||
++ apse ^+ . :: by prefix style
|
||||
?- sty.pic
|
||||
$done !! :: blank
|
||||
$rule (push %rule) :: horizontal ruler
|
||||
$head (push %head) :: heading
|
||||
$bloc (entr %bloc) :: blockquote line
|
||||
$expr (entr %expr) :: hoon expression
|
||||
$lite (lent %list) :: unnumbered list
|
||||
$lint (lent %lord) :: numbered list
|
||||
$text text :: anything else
|
||||
==
|
||||
::
|
||||
++ fail .(err `erp) :: set error position
|
||||
++ push |=(mite +>(hac [cur hac], cur [+< ~])):: push context
|
||||
++ entr :: enter container
|
||||
|= typ/mite
|
||||
^+ +>
|
||||
::
|
||||
:: indent by 2
|
||||
=. col (add 2 col)
|
||||
::
|
||||
:: "parse" marker
|
||||
=. los (slag (sub col q.naz) los)
|
||||
=. q.naz col
|
||||
::
|
||||
(push typ)
|
||||
::
|
||||
++ lent :: list entry
|
||||
|= ord/?($lord $list)
|
||||
^+ +>
|
||||
:: can't switch list types
|
||||
?: =(?-(ord $list %lord, $lord %list) p.cur)
|
||||
fail
|
||||
::
|
||||
:: push list item
|
||||
=< (entr %lime)
|
||||
::
|
||||
:: push list context, unless we're in list
|
||||
?:(=(ord p.cur) ..push (push ord))
|
||||
::
|
||||
++ text :: plain text
|
||||
^+ .
|
||||
::
|
||||
:: only in lists, fold
|
||||
?. ?=(?($list $lord) p.cur) .
|
||||
.(^$ fold)
|
||||
--
|
||||
--
|
||||
::
|
||||
++ parse :: individual parsers
|
||||
|%
|
||||
++ look :: classify line
|
||||
%+ cook |=(a/(unit trig) a)
|
||||
;~ pfix (star ace)
|
||||
%+ here
|
||||
|=({a/pint b/?($~ trig-style)} ?~(b ~ `[q.p.a b]))
|
||||
;~ pose
|
||||
(full (easy %done)) :: end of input
|
||||
(cold ~ (just `@`10)) :: blank line
|
||||
(cold %rule ;~(plug hep hep hep)) :: --- horizontal ruler
|
||||
(cold %head ;~(plug (star hax) ace)) :: # heading
|
||||
(cold %lite ;~(plug hep ace)) :: - line item
|
||||
(cold %lint ;~(plug lus ace)) :: + line item
|
||||
(cold %bloc ;~(plug gar ace)) :: > block-quote
|
||||
(cold %expr sem) :: ;sail expression
|
||||
(easy %text) :: anything else
|
||||
==
|
||||
==
|
||||
::
|
||||
++ cash :: escaped fence
|
||||
|* tem/rule
|
||||
%- echo
|
||||
%- star
|
||||
;~ pose
|
||||
whit
|
||||
;~(plug bas tem)
|
||||
;~(less tem prn)
|
||||
==
|
||||
::
|
||||
++ cool :: reparse
|
||||
|* $: :: fex: primary parser
|
||||
:: sab: secondary parser
|
||||
::
|
||||
fex/rule
|
||||
sab/rule
|
||||
==
|
||||
|= {naz/hair los/tape}
|
||||
^+ *sab
|
||||
::
|
||||
:: vex: fenced span
|
||||
=/ vex/(like tape) (fex naz los)
|
||||
?~ q.vex vex
|
||||
::
|
||||
:: hav: reparse full fenced text
|
||||
=/ hav ((full sab) [naz p.u.q.vex])
|
||||
::
|
||||
:: reparsed error position is always at start
|
||||
?~ q.hav [naz ~]
|
||||
::
|
||||
:: the complete span with the main product
|
||||
:- p.vex
|
||||
`[p.u.q.hav q.u.q.vex]
|
||||
::
|
||||
::REVIEW surely there is a less hacky "first or after space" solution
|
||||
++ easy-sol :: parse start of line
|
||||
|* a/*
|
||||
|= b/nail
|
||||
?: =(1 q.p.b) ((easy a) b)
|
||||
(fail b)
|
||||
::
|
||||
++ echo :: hoon literal
|
||||
|* sab/rule
|
||||
|= {naz/hair los/tape}
|
||||
^- (like tape)
|
||||
::
|
||||
:: vex: result of parsing wide twig
|
||||
=/ vex (sab naz los)
|
||||
::
|
||||
:: use result of expression parser
|
||||
?~ q.vex vex
|
||||
=- [p.vex `[- q.u.q.vex]]
|
||||
::
|
||||
:: but replace payload with bytes consumed
|
||||
|- ^- tape
|
||||
?: =(q.q.u.q.vex los) ~
|
||||
?~ los ~
|
||||
[i.los $(los +.los)]
|
||||
::
|
||||
++ word :: flow parser
|
||||
%+ knee *(list graf) |. ~+
|
||||
%+ cook |=(a/?(graf (list graf)) ?+(a a {@ *} [a]~))
|
||||
;~ pose
|
||||
::
|
||||
:: ordinary word
|
||||
::
|
||||
%+ stag %text
|
||||
;~(plug ;~(pose low hig) (star ;~(pose nud low hig hep)))
|
||||
::
|
||||
:: naked \escape
|
||||
::
|
||||
(stag %text ;~(pfix bas (cook trip ;~(less ace prn))))
|
||||
::
|
||||
:: *bold literal*
|
||||
::
|
||||
(stag %bold (ifix [tar tar] (cool (cash tar) work)))
|
||||
::
|
||||
:: _italic literal_
|
||||
::
|
||||
(stag %talc (ifix [cab cab] (cool (cash cab) work)))
|
||||
::
|
||||
:: "quoted text"
|
||||
::
|
||||
(stag %quod (ifix [doq doq] (cool (cash doq) work)))
|
||||
::
|
||||
:: `classic markdown quote`
|
||||
::
|
||||
(stag %code (ifix [tec tec] (cash tec)))
|
||||
::
|
||||
:: ++arm
|
||||
::
|
||||
(stag %code ;~(plug lus lus low (star ;~(pose nud low hep))))
|
||||
::
|
||||
:: [arbitrary *content*](url)
|
||||
::
|
||||
%+ stag %link
|
||||
;~ (glue (punt whit))
|
||||
(ifix [sel ser] (cool (cash ser) work))
|
||||
(ifix [pel per] (cash per))
|
||||
==
|
||||
::
|
||||
:: #twig
|
||||
::
|
||||
;~ plug
|
||||
(stag %text ;~(pose (cold " " whit) (easy-sol ~)))
|
||||
(stag %code ;~(pfix hax (echo wide)))
|
||||
;~(simu whit (easy ~))
|
||||
==
|
||||
::
|
||||
:: direct hoon constant
|
||||
::
|
||||
;~ plug
|
||||
(stag %text ;~(pose (cold " " whit) (easy-sol ~)))
|
||||
::
|
||||
%+ stag %code
|
||||
%- echo
|
||||
;~ pose
|
||||
::REVIEW just copy in 0x... parsers directly?
|
||||
;~(simu ;~(plug (just '0') alp) bisk:so)
|
||||
::
|
||||
tash:so
|
||||
;~(pfix dot perd:so)
|
||||
;~(pfix sig ;~(pose twid:so (easy [%$ %n 0])))
|
||||
;~(pfix cen ;~(pose sym buc pam bar qut nuck:so))
|
||||
==
|
||||
::
|
||||
;~(simu whit (easy ~))
|
||||
==
|
||||
::
|
||||
:: whitespace
|
||||
::
|
||||
(stag %text (cold " " whit))
|
||||
::
|
||||
:: {interpolated} sail
|
||||
::
|
||||
(stag %expr inline-embed:(sail |))
|
||||
::
|
||||
:: just a byte
|
||||
::
|
||||
(stag %text (cook trip ;~(less ace prn)))
|
||||
==
|
||||
::
|
||||
++ work (cook zing (star word)) :: indefinite flow
|
||||
::
|
||||
++ down :: parse inline flow
|
||||
%+ knee *flow |. ~+
|
||||
=- (cook - work)
|
||||
::
|
||||
:: collect raw flow into xml tags
|
||||
|= gaf/(list graf)
|
||||
^- flow
|
||||
=< main
|
||||
|%
|
||||
++ main
|
||||
^- flow
|
||||
?~ gaf ~
|
||||
?. ?=($text -.i.gaf)
|
||||
(weld (item i.gaf) $(gaf t.gaf))
|
||||
::
|
||||
:: fip: accumulate text blocks
|
||||
=/ fip/(list tape) [p.i.gaf]~
|
||||
|- ^- flow
|
||||
?~ t.gaf [;/((zing (flop fip))) ~]
|
||||
?. ?=($text -.i.t.gaf)
|
||||
[;/((zing (flop fip))) ^$(gaf t.gaf)]
|
||||
$(gaf t.gaf, fip :_(fip p.i.t.gaf))
|
||||
::
|
||||
++ item
|
||||
|= nex/graf
|
||||
^- flow ::CHECK can be tuna:twig?
|
||||
?- -.nex
|
||||
$text !! :: handled separately
|
||||
$expr [p.nex]~
|
||||
$bold [[%b ~] ^$(gaf p.nex)]~
|
||||
$talc [[%i ~] ^$(gaf p.nex)]~
|
||||
$code [[%code ~] ;/(p.nex) ~]~
|
||||
$quod ::
|
||||
:: smart quotes
|
||||
%= ^$
|
||||
gaf
|
||||
:- [%text (tufa ~-~201c. ~)]
|
||||
%+ weld p.nex
|
||||
`(list graf)`[%text (tufa ~-~201d. ~)]~
|
||||
==
|
||||
$link [[%a [%href q.nex] ~] ^$(gaf p.nex)]~
|
||||
==
|
||||
--
|
||||
::
|
||||
++ hrul :: empty besides fence
|
||||
(cold ~ ;~(plug hep hep hep (star hep) (just '\0a')))
|
||||
::
|
||||
++ para :: paragraph
|
||||
%+ cook
|
||||
|=(a/flow ?~(a ~ [[%p ~] a]~))
|
||||
;~(pfix (punt whit) down)
|
||||
::
|
||||
++ expr :: expression
|
||||
%+ ifix [(punt whit) (punt whit)] :: whitespace surround
|
||||
=> (sail &) :: tall-form
|
||||
(cook drop-top top-level) :: list of tags
|
||||
::
|
||||
::
|
||||
++ whit :: whitespace
|
||||
(cold ' ' (plus ;~(pose (just ' ') (just '\0a'))))
|
||||
::
|
||||
++ head :: parse heading
|
||||
%+ cook
|
||||
|= a/manx:twig ^- marl:twig
|
||||
=. a.g.a :_(a.g.a [%id (sanitize-to-id c.a)])
|
||||
[a]~
|
||||
::
|
||||
;~ plug
|
||||
::
|
||||
:: # -> 1 -> %h1, ### -> 3 -> %h3, etc
|
||||
:(cook |=(a/@u /(crip "h{<a>}")) lent (stun [1 6] hax))
|
||||
::
|
||||
;~(pfix whit down)
|
||||
==
|
||||
::
|
||||
++ sanitize-to-id :: # text into elem id
|
||||
|= a/(list tuna:twig) ^- tape
|
||||
=; raw/tape
|
||||
%+ turn raw
|
||||
|= @tD
|
||||
^- @tD
|
||||
?: ?| &((gte +< 'a') (lte +< 'z'))
|
||||
&((gte +< '0') (lte +< '9'))
|
||||
==
|
||||
+<
|
||||
?: &((gte +< 'A') (lte +< 'Z'))
|
||||
(add 32 +<)
|
||||
'-'
|
||||
::
|
||||
:: collect all text in header flow
|
||||
|- ^- tape
|
||||
?~ a ~
|
||||
%+ weld
|
||||
^- tape
|
||||
?- i.a
|
||||
{{$$ {$$ *} $~} $~} :: text node contents
|
||||
(murn v.i.a.g.i.a |=(a/beer:twig ?^(a ~ (some a))))
|
||||
{^ *} $(a c.i.a) :: concatenate children
|
||||
{@ *} ~ :: ignore interpolation
|
||||
==
|
||||
$(a t.a)
|
||||
--
|
||||
--
|
||||
++ scab
|
||||
%+ cook
|
||||
|= a/(list wing) ^- twig
|
||||
@ -10699,15 +11365,19 @@
|
||||
apex:docs
|
||||
fel
|
||||
apse:docs
|
||||
==
|
||||
++ tall %+ knee *twig :: full tall form
|
||||
|.(~+((wart (wrap ;~(pose (norm | &) long lute apex:(sail &))))))
|
||||
++ till %+ knee *root :: full tall form
|
||||
|.(~+((wart (wrap ;~(pose (norm & &) scad)))))
|
||||
++ wide %+ knee *twig :: full wide form
|
||||
|.(~+((wart ;~(pose (norm | |) long apex:(sail |)))))
|
||||
++ wyde %+ knee *root :: full wide form
|
||||
|.(~+((wart ;~(pose (norm & |) scad))))
|
||||
==
|
||||
++ tall :: full tall form
|
||||
%+ knee *twig
|
||||
|.(~+((wart (wrap ;~(pose (norm | &) cram long lute apex:(sail &))))))
|
||||
++ till :: mold tall form
|
||||
%+ knee *root
|
||||
|.(~+((wart (wrap ;~(pose (norm & &) scad)))))
|
||||
++ wide :: full wide form
|
||||
%+ knee *twig
|
||||
|.(~+((wart ;~(pose (norm | |) long apex:(sail |)))))
|
||||
++ wyde :: mold wide form
|
||||
%+ knee *root
|
||||
|.(~+((wart ;~(pose (norm & |) scad))))
|
||||
++ wart
|
||||
|* zor/rule
|
||||
%+ here
|
||||
|
@ -535,7 +535,7 @@
|
||||
++ peek :: external inspect
|
||||
|= {now/@da hap/path}
|
||||
^- (unit)
|
||||
?~ hap [~ hoon]
|
||||
?~ hap [~ hoon-version]
|
||||
=+ rob=((sloy ~(beck (is vil eny bud niz) now)) [151 %noun] hap)
|
||||
?~ rob ~
|
||||
?~ u.rob ~
|
||||
@ -572,9 +572,9 @@
|
||||
=+ ^= nex
|
||||
=+ gat=.*(ken .*(ken [0 87]))
|
||||
(need ((hard (unit @)) .*([-.gat [[now ~] +>.gat]] -.gat)))
|
||||
~& [%vega-compiled hoon nex]
|
||||
?> (lte nex hoon)
|
||||
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)]))
|
||||
~& [%vega-compiled hoon-version nex]
|
||||
?> (lte nex hoon-version)
|
||||
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon-version) 86 11)]))
|
||||
=+ sam=[eny ova q.niz]
|
||||
=+ raw=.*([-.gat [sam +>.gat]] -.gat)
|
||||
=+ yep=((list ovum) -.raw)
|
||||
|
@ -291,11 +291,11 @@
|
||||
0w0 :: 174, ~hut, Tlon
|
||||
0w0 :: 175, ~tun, Tlon
|
||||
0w0 :: 176, ~byl, Tlon
|
||||
0w0 :: 177, ~sud, Tlon
|
||||
0w0 :: 178, ~pem, Tlon
|
||||
0wq.wmRvk.V8tZ5.1lz5q.dbrYx :: 177, ~sud, Tlon
|
||||
0w3Q.0LYXy.LjTEu.~FjaT.OpTts :: 178, ~pem, Tlon
|
||||
0wQ.uJzGo.M94yL.L7yw6.nGyfW :: 179, ~dev, Tlon
|
||||
0w0 :: 180, ~lur, Tlon
|
||||
0w0 :: 181, ~def, Tlon
|
||||
0w1B.LTLDt.3Yu~s.BuzYM.fjcS3 :: 180, ~lur, Tlon
|
||||
0w2B.9j6g-.q9DwV.tXzPz.DKEKq :: 181, ~def, Tlon
|
||||
0w1m.CxbiW.SKF5E.11JQ6.yW~T4 :: 182, ~bus, Tlon
|
||||
0w0 :: 183, ~bep, Tlon
|
||||
0w0 :: 184, ~run, Tlon
|
||||
|
@ -141,84 +141,6 @@
|
||||
^+ a
|
||||
(meek (uniq a) (uniq q))
|
||||
--
|
||||
++ neon
|
||||
|= our/ship
|
||||
^- (vane task:able gift:able $~ $~ coke coke)
|
||||
=| coke
|
||||
|%
|
||||
++ load |=(coke +>)
|
||||
++ stay `coke`+<
|
||||
++ plow
|
||||
=| $: now/@da
|
||||
eny/@e
|
||||
sky/roof
|
||||
==
|
||||
|%
|
||||
++ doze ~
|
||||
++ peek
|
||||
|= $: lyc/(unit (set ship))
|
||||
car/term
|
||||
bem/beam
|
||||
==
|
||||
^- (unit (unit (cask vase)))
|
||||
::
|
||||
:: XX this is old and somewhat retarded
|
||||
::
|
||||
=+ ^= liz
|
||||
|- ^- (list {@da duct})
|
||||
=. tym (raze tym)
|
||||
?~ p.tym ~
|
||||
[~(get up p.tym) $(p.tym ~(pop up p.tym))]
|
||||
[~ ~ %tank !>(>liz<)]
|
||||
::
|
||||
++ spin
|
||||
=| $: hen/duct
|
||||
moz/(list (pair duct (wind $~ gift:able)))
|
||||
==
|
||||
|%
|
||||
++ call
|
||||
|= tac/task:able
|
||||
^+ +>
|
||||
=^ mof tym
|
||||
?- -.tac
|
||||
$rest
|
||||
=. q.tym (~(put up q.tym) p.tac hen)
|
||||
=. tym (raze tym)
|
||||
[~ tym]
|
||||
::
|
||||
$wait
|
||||
=. p.tym (~(put up p.tym) p.tac hen)
|
||||
=. tym (raze tym)
|
||||
[~ tym]
|
||||
::
|
||||
$wake
|
||||
|- ^+ [*(list move) tym]
|
||||
=. tym (raze tym)
|
||||
?: =([~ ~] tym) [~ tym] :: XX TMI
|
||||
?: =(~ p.tym)
|
||||
~& %weird-wake [~ tym]
|
||||
=+ nex=~(get up p.tym)
|
||||
?: (lte now p.nex) [~ tym]
|
||||
=^ mof tym $(p.tym ~(pop up p.tym))
|
||||
[[`move`[q.nex %give %wake ~] mof] tym]
|
||||
::
|
||||
$wegh
|
||||
:_ tym :_ ~
|
||||
:^ hen %give %mass
|
||||
:- %behn
|
||||
:- %|
|
||||
:~ tym+[%& tym]
|
||||
==
|
||||
==
|
||||
+>.$(moz (weld `(list move)`mof moz))
|
||||
::
|
||||
++ take
|
||||
|= {tea/wire $~}
|
||||
^+ +>
|
||||
!!
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
. ==
|
||||
=| $: $0 ::
|
||||
|
@ -3726,418 +3726,4 @@
|
||||
?~ -
|
||||
`[paf %ins %mime -:!>(*mime) u.mim]
|
||||
`[paf %mut %mime -:!>(*mime) u.mim]
|
||||
::
|
||||
++ neon
|
||||
|= our/ship
|
||||
^- (vane task:able gift:able sign note raft raft)
|
||||
=| ruf/raft
|
||||
|%
|
||||
++ load |=(raft +>)
|
||||
++ stay `raft`+<
|
||||
++ plow
|
||||
=| $: now/@da
|
||||
eny/@e
|
||||
sky/roof
|
||||
==
|
||||
|%
|
||||
++ doze ~
|
||||
++ peek
|
||||
|= $: lyc/(unit (set ship))
|
||||
car/term
|
||||
bem/beam
|
||||
==
|
||||
^- (unit (unit (cask vase)))
|
||||
=* his p.bem
|
||||
=+ got=(~(has by fat.ruf) his)
|
||||
?: =(%$ car)
|
||||
[~ ~]
|
||||
=+ run=((soft care) car)
|
||||
?~ run [~ ~]
|
||||
=+ den=((de now [/scryduct ~] ruf) [. .]:his q.bem)
|
||||
=+ (aver:den u.run r.bem s.bem)
|
||||
?~ - -
|
||||
?~ u.- -
|
||||
?: ?=($& -.u.u.-) ``p.u.u.-
|
||||
~
|
||||
::
|
||||
++ spin
|
||||
=| $: hen/duct
|
||||
moz/(list (pair duct (wind note gift:able)))
|
||||
==
|
||||
|%
|
||||
++ call
|
||||
|= tac/task:able
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
^+ [p=*(list move) q=+>]
|
||||
?- -.tac
|
||||
$boat
|
||||
:_ +>.$
|
||||
[hen %give %hill (turn ~(tap by mon.ruf) head)]~
|
||||
::
|
||||
$drop
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:p.tac q.tac)
|
||||
abet:drop-me:den
|
||||
[mos +>.$]
|
||||
::
|
||||
$info
|
||||
?: =(%$ q.tac)
|
||||
[~ +>.$]
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:p.tac q.tac)
|
||||
abet:(edit:den now r.tac)
|
||||
[mos +>.$]
|
||||
::
|
||||
$init
|
||||
:_ %_ +>.$
|
||||
fat.ruf
|
||||
?< (~(has by fat.ruf) p.tac)
|
||||
(~(put by fat.ruf) p.tac [-(hun hen)]:[*room .])
|
||||
==
|
||||
=+ [bos=(sein:title p.tac) can=(clan:title p.tac)]
|
||||
%- zing ^- (list (list move))
|
||||
:~ ?: =(bos p.tac) ~
|
||||
:_ ~
|
||||
:* hen
|
||||
%pass
|
||||
/init-merge
|
||||
%c
|
||||
%merg
|
||||
p.tac
|
||||
%base
|
||||
bos
|
||||
%kids
|
||||
da+now
|
||||
%init
|
||||
==
|
||||
::
|
||||
~
|
||||
==
|
||||
::
|
||||
$into
|
||||
=. hez.ruf `hen
|
||||
:_ +>.$
|
||||
=+ bem=(~(get by mon.ruf) p.tac)
|
||||
?: &(?=($~ bem) !=(%$ p.tac))
|
||||
~|([%bad-mount-point-from-unix p.tac] !!)
|
||||
=+ ^- bem/beam
|
||||
?^ bem
|
||||
u.bem
|
||||
[[?>(?=(^ fat.ruf) p.n.fat.ruf) %base %ud 1] ~]
|
||||
=+ rom=(~(get by fat.ruf) p.bem)
|
||||
?~ rom
|
||||
~
|
||||
=+ dos=(~(get by dos.u.rom) q.bem)
|
||||
?~ dos
|
||||
~
|
||||
?: =(0 let.dom.u.dos)
|
||||
=+ cos=(mode-to-soba ~ s.bem q.tac r.tac)
|
||||
=+ ^- {one/(list {path miso}) two/(list {path miso})}
|
||||
%+ skid cos
|
||||
|= {a/path b/miso}
|
||||
?& ?=($ins -.b)
|
||||
?=($mime p.p.b)
|
||||
?=({$hoon $~} (slag (dec (lent a)) a))
|
||||
==
|
||||
:~ [hen %pass /one %c %info p.bem q.bem %& one]
|
||||
[hen %pass /two %c %info p.bem q.bem %& two]
|
||||
==
|
||||
=+ ^= yak
|
||||
%- ~(got by hut.ran.ruf)
|
||||
(~(got by hit.dom.u.dos) let.dom.u.dos)
|
||||
=+ cos=(mode-to-soba q.yak (flop s.bem) q.tac r.tac)
|
||||
[hen %pass /both %c %info p.bem q.bem %& cos]~
|
||||
::
|
||||
$merg :: direct state up
|
||||
?: =(%$ q.tac)
|
||||
[~ +>.$]
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:p.tac q.tac)
|
||||
abet:abet:(start:(me:ze:den [r.tac s.tac] ~ &) t.tac u.tac)
|
||||
[mos +>.$]
|
||||
::
|
||||
$mont
|
||||
=. hez.ruf ?^(hez.ruf hez.ruf `[[%$ %sync ~] ~])
|
||||
=+ pot=(~(get by mon.ruf) p.tac)
|
||||
?^ pot
|
||||
~& [%already-mounted pot]
|
||||
[~ +>.$]
|
||||
=. mon.ruf
|
||||
(~(put by mon.ruf) p.tac [p.q.tac q.q.tac r.q.tac] s.q.tac)
|
||||
=+ yar=(~(get by fat.ruf) p.q.tac)
|
||||
?~ yar
|
||||
[~ +>.$]
|
||||
=+ dos=(~(get by dos.u.yar) q.q.tac)
|
||||
?~ dos
|
||||
[~ +>.$]
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:p.q.tac q.q.tac)
|
||||
abet:(mont:den p.tac q.tac)
|
||||
[mos +>.$]
|
||||
::
|
||||
$dirk
|
||||
?~ hez.ruf
|
||||
~& %no-sync-duct
|
||||
[~ +>.$]
|
||||
?. (~(has by mon.ruf) p.tac)
|
||||
~& [%not-mounted p.tac]
|
||||
[~ +>.$]
|
||||
:- ~[[u.hez.ruf %give %dirk p.tac]]
|
||||
+>.$
|
||||
::
|
||||
$ogre
|
||||
?~ hez.ruf
|
||||
~& %no-sync-duct
|
||||
[~ +>.$]
|
||||
?@ p.tac
|
||||
?. (~(has by mon.ruf) p.tac)
|
||||
~& [%not-mounted p.tac]
|
||||
[~ +>.$]
|
||||
:_ +>.$(mon.ruf (~(del by mon.ruf) p.tac))
|
||||
[u.hez.ruf %give %ogre p.tac]~
|
||||
:_ %_ +>.$
|
||||
mon.ruf
|
||||
%- molt
|
||||
%+ skip ~(tap by mon.ruf)
|
||||
(corl (cury test p.tac) tail)
|
||||
==
|
||||
%+ turn
|
||||
(skim ~(tap by mon.ruf) (corl (cury test p.tac) tail))
|
||||
|= {pot/term bem/beam}
|
||||
[u.hez.ruf %give %ogre pot]
|
||||
::
|
||||
$warp
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) p.tac p.q.tac)
|
||||
:: =- ~? ?=([~ %sing %w *] q.q.tac)
|
||||
:: :* %someones-warping
|
||||
:: rav=u.q.q.tac
|
||||
:: mos=-<
|
||||
:: ==
|
||||
:: -
|
||||
=< abet
|
||||
?~ q.q.tac
|
||||
cancel-request:den
|
||||
(start-request:den u.q.q.tac)
|
||||
[mos +>.$]
|
||||
::
|
||||
$went
|
||||
:: this won't happen until we send responses.
|
||||
!!
|
||||
::
|
||||
$west
|
||||
?: ?=({$question *} q.tac)
|
||||
=+ ryf=((hard riff) r.tac)
|
||||
:_ +>.$
|
||||
:~ [hen %give %mack ~]
|
||||
:- hen
|
||||
:^ %pass [(scot %p p.p.tac) (scot %p q.p.tac) t.q.tac]
|
||||
%c
|
||||
[%warp [p.p.tac p.p.tac] ryf]
|
||||
==
|
||||
?> ?=({$answer @ @ $~} q.tac)
|
||||
=+ syd=(slav %tas i.t.q.tac)
|
||||
=+ inx=(slav %ud i.t.t.q.tac)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) p.tac syd)
|
||||
abet:(take-foreign-update:den inx ((hard (unit rand)) r.tac))
|
||||
[[[hen %give %mack ~] mos] +>.$]
|
||||
::
|
||||
$wegh
|
||||
:_ +>.$ :_ ~
|
||||
:^ hen %give %mass
|
||||
:- %clay
|
||||
:- %|
|
||||
:~ domestic+[%& fat.ruf]
|
||||
foreign+[%& hoy.ruf]
|
||||
:- %object-store :- %|
|
||||
:~ commits+[%& hut.ran.ruf]
|
||||
blobs+[%& lat.ran.ruf]
|
||||
==
|
||||
==
|
||||
==
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
::
|
||||
++ take
|
||||
|= {tea/wire hin/sign}
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
^+ [p=*(list move) q=+>]
|
||||
?: ?=({$merge @ @ @ @ @ $~} tea)
|
||||
?> ?=(?($writ $made) +<.hin)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=* syd i.t.t.tea
|
||||
=+ her=(slav %p i.t.t.t.tea)
|
||||
=* sud i.t.t.t.t.tea
|
||||
=* sat i.t.t.t.t.t.tea
|
||||
=+ dat=?-(+<.hin $writ [%& p.hin], $made [%| q.hin])
|
||||
=+ ^- kan/(unit dome)
|
||||
%+ biff (~(get by fat.ruf) her)
|
||||
|= room
|
||||
%+ bind (~(get by dos) sud)
|
||||
|= dojo
|
||||
dom
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:abet:(route:(me:ze:den [her sud] kan |) sat dat)
|
||||
[mos +>.$]
|
||||
?: ?=({$blab care @ @ *} tea)
|
||||
?> ?=($made +<.hin)
|
||||
?. ?=($& -.q.hin)
|
||||
~| %blab-fail
|
||||
~> %mean.|.(?+(-.q.hin -.q.hin $| p.q.hin))
|
||||
:: interpolate ford fail into stack trace
|
||||
!!
|
||||
:_ +>.$ :_ ~
|
||||
:* hen %give %writ ~
|
||||
^- {care case @tas}
|
||||
[i.t.tea ((hard case) +>:(slay i.t.t.tea)) i.t.t.t.tea]
|
||||
::
|
||||
`path`t.t.t.t.tea
|
||||
`cage`p.q.hin
|
||||
==
|
||||
?- -.+.hin
|
||||
::
|
||||
$send
|
||||
[[[hen %give +.q.hin] ~] ..^$]
|
||||
::
|
||||
$crud
|
||||
[[[hen %slip %d %flog +.hin] ~] +>.$]
|
||||
::
|
||||
$made
|
||||
?~ tea !!
|
||||
?+ -.tea !!
|
||||
$inserting
|
||||
?> ?=({@ @ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=+ wen=(slav %da i.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-inserting:den wen q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$diffing
|
||||
?> ?=({@ @ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=+ wen=(slav %da i.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-diffing:den wen q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$castifying
|
||||
?> ?=({@ @ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=+ wen=(slav %da i.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-castify:den wen q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$mutating
|
||||
?> ?=({@ @ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=+ wen=(slav %da i.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-mutating:den wen q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$patching
|
||||
?> ?=({@ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-patch:den q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$ergoing
|
||||
?> ?=({@ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [. .]:our syd)
|
||||
abet:(take-ergo:den q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$foreign-plops
|
||||
?> ?=({@ @ @ @ $~} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ her=(slav %p i.t.t.tea)
|
||||
=* syd i.t.t.t.tea
|
||||
=+ lem=(slav %da i.t.t.t.t.tea)
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [our her] syd)
|
||||
abet:(take-foreign-plops:den ?~(lem ~ `lem) q.hin)
|
||||
[mos +>.$]
|
||||
::
|
||||
$foreign-x
|
||||
?> ?=({@ @ @ @ @ *} t.tea)
|
||||
=+ our=(slav %p i.t.tea)
|
||||
=+ her=(slav %p i.t.t.tea)
|
||||
=+ syd=(slav %tas i.t.t.t.tea)
|
||||
=+ car=((hard care) i.t.t.t.t.tea)
|
||||
=+ ^- cas/case
|
||||
=+ (slay i.t.t.t.t.t.tea)
|
||||
?> ?=({$~ $$ case} -)
|
||||
->+
|
||||
=* pax t.t.t.t.t.t.tea
|
||||
=^ mos ruf
|
||||
=+ den=((de now hen ruf) [our her] syd)
|
||||
abet:(take-foreign-x:den car cas pax q.hin)
|
||||
[mos +>.$]
|
||||
==
|
||||
::
|
||||
$mere
|
||||
?: ?=($& -.p.+.hin)
|
||||
~& 'initial merge succeeded'
|
||||
[~ +>.$]
|
||||
~> %slog.
|
||||
:^ 0 %rose [" " "[" "]"]
|
||||
:^ leaf+"initial merge failed"
|
||||
leaf+"my most sincere apologies"
|
||||
>p.p.p.+.hin<
|
||||
q.p.p.+.hin
|
||||
[~ +>.$]
|
||||
::
|
||||
$note [[hen %give +.hin]~ +>.$]
|
||||
$wake
|
||||
~| %why-wakey !!
|
||||
:: =+ dal=(turn ~(tap by fat.ruf) |=([a=@p b=room] a))
|
||||
:: =| mos=(list move)
|
||||
:: |- ^- [p=(list move) q=_..^^$]
|
||||
:: ?~ dal [mos ..^^$]
|
||||
:: =+ une=(un i.dal now hen ruf)
|
||||
:: =^ som une wake:une
|
||||
:: $(dal t.dal, ruf abet:une, mos (weld som mos))
|
||||
::
|
||||
$writ
|
||||
?> ?=({@ @ *} tea)
|
||||
~| i=i.tea
|
||||
~| it=i.t.tea
|
||||
=+ our=(slav %p i.tea)
|
||||
=+ him=(slav %p i.t.tea)
|
||||
:_ +>.$
|
||||
:~ :* hen %pass /writ-want %a
|
||||
%want [our him] [%c %answer t.t.tea]
|
||||
(bind p.+.hin rant-to-rand)
|
||||
==
|
||||
==
|
||||
::
|
||||
$woot
|
||||
[~ +>.$]
|
||||
:: ?~ r.hin [~ +>.$]
|
||||
:: ~& [%clay-lost p.hin r.hin tea]
|
||||
:: [~ +>.$]
|
||||
==
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
|
@ -538,90 +538,4 @@
|
||||
=^ moz all
|
||||
abet:(~(take as [~ hen our] (~(got by dug.all) hen)) q.hin)
|
||||
[moz ..^$]
|
||||
::
|
||||
++ neon
|
||||
|= our/ship
|
||||
^- (vane task:able gift:able sign note axle axle)
|
||||
=| all/axle
|
||||
|%
|
||||
++ load |=(axle +>)
|
||||
++ stay `axle`+<
|
||||
++ plow
|
||||
=| $: now/@da
|
||||
eny/@e
|
||||
sky/roof
|
||||
==
|
||||
|%
|
||||
++ doze ~
|
||||
++ peek
|
||||
|= $: lyc/(unit (set ship))
|
||||
car/term
|
||||
bem/beam
|
||||
==
|
||||
^- (unit (unit (cask vase)))
|
||||
[~ ~]
|
||||
::
|
||||
++ spin
|
||||
=| $: hen/duct
|
||||
moz/(list (pair duct (wind note gift:able)))
|
||||
==
|
||||
|%
|
||||
++ call
|
||||
|= tac/task:able
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
?: ?=($boot -.tac)
|
||||
:_(+>.$ [hen %pass ~ (note %a p.tac)]~)
|
||||
?: ?=($flog -.tac)
|
||||
:: ~& [%dill-flog +.tac]
|
||||
?: ?=({$crud $hax-init {$leaf *} $~} p.tac)
|
||||
=+ him=(slav %p (crip p.i.q.p.tac))
|
||||
:_(+>.$ ?~(hey.all ~ [u.hey.all %give %init him]~))
|
||||
?: ?=({$crud $hax-heft $~} p.tac)
|
||||
:_(+>.$ ?~(hey.all ~ [u.hey.all %slip %d %heft ~]~))
|
||||
:_(+>.$ ?~(hey.all ~ [u.hey.all %slip %d p.tac]~))
|
||||
=. hey.all ?^(hey.all hey.all `hen)
|
||||
?: ?=($init -.tac)
|
||||
:: ~& [%cnhp-init hen]
|
||||
?: =(ore.all `p.tac)
|
||||
[[hen %give tac]~ +>.$]
|
||||
=: ore.all `p.tac
|
||||
dug.all ~
|
||||
==
|
||||
=^ moz all abet:(need (ax (need hey.all) [%flow %hood ~]))
|
||||
?: |((lth p.tac 256) (gte p.tac (bex 64)))
|
||||
[moz +>.$] :: XX HORRIBLE
|
||||
[:_(moz [(need hey.all) %give %init p.tac]) +>.$]
|
||||
=+ nus=(ax hen tac)
|
||||
?~ nus
|
||||
~& [%dill-no-flow tac]
|
||||
[~ +>.$]
|
||||
=^ moz all abet:(call:u.nus tac)
|
||||
[moz +>.$]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
::
|
||||
++ take
|
||||
|= {tea/wire hin/sign}
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
?: =(~ ore.all)
|
||||
?: ?=({$a $init *} hin)
|
||||
:: ~& [%take-init hen]
|
||||
=. hey.all ?^(hey.all hey.all `hen)
|
||||
[[[hen %give +.hin] ~] +>.$]
|
||||
:: [~ +>.$]
|
||||
~& [%take-back hin]
|
||||
[~ +>.$]
|
||||
?. (~(has by dug.all) hen)
|
||||
~& [%take-weird-sign hin]
|
||||
~& [%take-weird-hen hen]
|
||||
[~ +>.$]
|
||||
=+ our=?>(?=(^ ore.all) u.ore.all)
|
||||
=^ moz all
|
||||
abet:(~(take as [~ hen our] (~(got by dug.all) hen)) hin)
|
||||
[moz +>.$]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
|
@ -2036,6 +2036,7 @@
|
||||
?+ syd [~ ~]
|
||||
$serv
|
||||
``[%path !>((en-beam top))]
|
||||
::
|
||||
$host
|
||||
%- (lift (lift |=(a/hart [%hart !>(a)])))
|
||||
^- (unit (unit hart))
|
||||
@ -2068,91 +2069,4 @@
|
||||
(axon:~(adit ye [hen [now eny our sky] ~] bol) u.tee q.hin)
|
||||
[mos ..^$]
|
||||
::
|
||||
++ neon
|
||||
|= our/ship
|
||||
^- (vane task:able gift:able sign note bolo bolo)
|
||||
=| bolo
|
||||
=* bol -
|
||||
|%
|
||||
++ load |=(bolo +>)
|
||||
++ stay `bolo`+<
|
||||
++ plow
|
||||
=| $: now/@da
|
||||
eny/@e
|
||||
sky/roof
|
||||
==
|
||||
|%
|
||||
++ doze ~
|
||||
++ peek
|
||||
|= $: lyc/(unit (set ship))
|
||||
car/term
|
||||
bem/beam
|
||||
==
|
||||
^- (unit (unit (cask vase)))
|
||||
=* who p.bem
|
||||
=+ ska=(auld sky)
|
||||
=+ sky=|=({* *} `(unit)`=+(a=(ska +<) ?~(a ~ ?~(u.a ~ [~ u.u.a]))))
|
||||
?. ?=($$ car) [~ ~]
|
||||
?+ q.bem [~ ~]
|
||||
$host
|
||||
%- (lift (lift |=(a/hart [%hart !>(a)])))
|
||||
^- (unit (unit hart))
|
||||
?. =(our who)
|
||||
?. =([%da now] r.bem) [~ ~]
|
||||
~& [%e %scry-foreign-host who]
|
||||
~ :: XX add non-scry binding to $hat gram
|
||||
=. r.bem ?.(=([%da now] r.bem) r.bem [%tas %real])
|
||||
?+ r.bem [~ ~]
|
||||
{$tas $fake} ``[& [~ 8.443] %& /localhost] :: XX from unix
|
||||
{$tas $real}
|
||||
``~(our-host ye [`duct`~[/] [now eny our sky] ~] bol)
|
||||
==
|
||||
==
|
||||
::
|
||||
++ spin
|
||||
=| $: hen/duct
|
||||
moz/(list (pair duct (wind note gift:able)))
|
||||
==
|
||||
|%
|
||||
++ call
|
||||
|= tac/task:able
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
^+ [p=*(list move) q=+>.$]
|
||||
?: ?=($wegh -.tac)
|
||||
:_ +>.$ :_ ~
|
||||
:^ hen %give %mass
|
||||
:- %eyre
|
||||
:- %|
|
||||
:~ dependencies+[%& liz] views+[%& wix]
|
||||
ducts+[%| ~[dead+[%& ded] proxy+[%& pox] outgoing+[%& ask]]]
|
||||
misc+[%& bol]
|
||||
==
|
||||
=+ ska=(auld sky)
|
||||
=+ sky=|=({* *} `(unit)`=+(a=(ska +<) ?~(a ~ ?~(u.a ~ [~ u.u.a]))))
|
||||
=. ney (shax :(mix (shax now) +(eny) ney))
|
||||
^+ [p=*(list move) q=+>.$]
|
||||
=^ mos bol
|
||||
abet:(apex:~(adit ye [hen [now eny our sky] ~] bol) tac)
|
||||
[mos +>.$]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
::
|
||||
++ take
|
||||
|= {tea/wire hin/sign}
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
=+ ska=(auld sky)
|
||||
=+ sky=|=({* *} `(unit)`=+(a=(ska +<) ?~(a ~ ?~(u.a ~ [~ u.u.a]))))
|
||||
=. ney (shax :(mix (shax now) +(eny) ney))
|
||||
^+ [p=*(list move) q=+>.$]
|
||||
=+ tee=((soft whir) tea)
|
||||
?~ tee ~& [%e %lost -.hin hen] [~ +>.$]
|
||||
=^ mos bol
|
||||
=< abet
|
||||
(axon:~(adit ye [hen [now eny our sky] ~] bol) u.tee hin)
|
||||
[mos +>.$]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
|
@ -1987,112 +1987,4 @@
|
||||
==
|
||||
abet:(~(axon za [our hen [now eny ski] ~] bay) num [van ren bem] q.hin)
|
||||
[mos ..^$(pol (~(put by pol) our bay))]
|
||||
::
|
||||
++ neon !:
|
||||
|= our/ship
|
||||
^- (^vane task:able gift:able sign note axle axle)
|
||||
=| axle
|
||||
=* lex -
|
||||
|%
|
||||
++ load |=(axle +>)
|
||||
++ stay `axle`+<(pol (~(run by pol) |=(a/baby [tad.a dym.a deh.a ~])))
|
||||
++ plow
|
||||
=| $: now/@da
|
||||
eny/@e
|
||||
sky/roof
|
||||
==
|
||||
|%
|
||||
++ doze ~
|
||||
++ peek
|
||||
|= $: lyc/(unit (set ship))
|
||||
car/term
|
||||
bem/beam
|
||||
==
|
||||
^- (unit (unit (cask vase)))
|
||||
[~ ~]
|
||||
::
|
||||
++ spin
|
||||
=| $: hen/duct
|
||||
moz/(list (pair duct (wind note gift:able)))
|
||||
==
|
||||
|%
|
||||
++ call
|
||||
|= tac/task:able
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
^+ [p=*(list move) q=+>.$]
|
||||
?: ?=($wegh -.tac)
|
||||
:_ +>.$ :_ ~
|
||||
:^ hen %give %mass
|
||||
:- %ford
|
||||
:- %|
|
||||
%- |= a/(list (list mass)) ^- (list mass)
|
||||
=+ a2=a
|
||||
?~ a !!
|
||||
?~ i.a ~
|
||||
:_ $(a (turn a2 tail))
|
||||
:- p.i.i.a
|
||||
?~ -.q.i.i.a
|
||||
[%& (turn (turn a2 head) |=(b/mass ?~(-.q.b p.q.b !!)))]
|
||||
[%| $(a (turn (turn a2 head) |=(b/mass ?~(-.q.b !! p.q.b))))]
|
||||
%+ turn ~(tap by pol)
|
||||
|= {@ baby}
|
||||
:~ =< :+ %cache
|
||||
%|
|
||||
(turn `(list term)`/hood/bake/slit/slim/slap/slam .)
|
||||
=- |=(a/term [a %& (~(get ja dep) a)])
|
||||
=< `dep/(jar term *)`(~(rep by jav) .)
|
||||
|=({{* a/{term *}} b/(jar term *)} (~(add ja b) -.a +.a))
|
||||
::
|
||||
=< depends+[%| (turn `(list term)`/init/sent/done .)]
|
||||
=- |=(a/term [a %& (~(get ja dep) a)])
|
||||
=< `dep/(jar term *)`(~(rep by deh) .)
|
||||
|=({{@ a/{term *}} b/(jar term *)} (~(add ja b) -.a +.a))
|
||||
::
|
||||
tasks+[%& dym tad]
|
||||
==
|
||||
=+ our=p.tac
|
||||
=+ ^= bay ^- baby
|
||||
=+ buy=(~(get by pol.lex) our)
|
||||
?~(buy *baby u.buy)
|
||||
=^ mos bay
|
||||
?- -.tac
|
||||
$wipe ~&(%ford-cache-wiped [~ bay(jav ~)])
|
||||
$wasp
|
||||
abet:(~(awap za [our hen [now eny ski] ~] bay) q.tac)
|
||||
$exec
|
||||
?~ q.tac
|
||||
abet:~(apax za [our hen [now eny ski] ~] bay)
|
||||
abet:(~(apex za [our hen [now eny ski] ~] bay) u.q.tac)
|
||||
==
|
||||
[mos +>.$(pol (~(put by pol) our bay))]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
::
|
||||
++ take
|
||||
|= {tea/wire hin/sign}
|
||||
^+ +>
|
||||
=^ vam +>
|
||||
^+ [p=*(list move) q=+>.$]
|
||||
?> ?=({@ @ *} tea)
|
||||
=+ our=(slav %p i.tea)
|
||||
=+ bay=(~(got by pol.lex) our)
|
||||
=^ mos bay
|
||||
=+ dep=(slaw %uv i.t.tea)
|
||||
?^ dep
|
||||
=+ bem=(need (de-beam t.t.tea))
|
||||
=< abet
|
||||
(~(axun za [our hen [now eny ski] ~] bay) tea u.dep bem hin)
|
||||
?> ?=({@ @ ^} t.t.tea)
|
||||
=+ :* num=(slav %ud i.t.tea)
|
||||
van=((hard vane) i.t.t.tea)
|
||||
ren=((hard care:clay) i.t.t.t.tea)
|
||||
bem=(need (de-beam t.t.t.t.tea))
|
||||
==
|
||||
=< abet
|
||||
(~(axon za [our hen [now eny ski] ~] bay) num [van ren bem] hin)
|
||||
[mos +>.$(pol (~(put by pol) our bay))]
|
||||
+>.$(moz (weld `(list move)`vam moz))
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
|
@ -778,7 +778,10 @@ module.exports = recl({
|
||||
case speech.url == null:
|
||||
return speechArr = speech.url.txt.split(/(\s|-)/);
|
||||
case speech.fat == null:
|
||||
return speech.fat.taf.exp.txt.split(/(\s|-)/);
|
||||
if (typeof speech.fat.taf.exp !== 'undefined') { return speech.fat.taf.exp.txt.split(/(\s|-)/); }
|
||||
if (typeof speech.fat.taf.app !== 'undefined') { return speech.fat.taf.app.txt; }
|
||||
if (typeof speech.fat.taf.lin !== 'undefined') { return speech.fat.taf.lin.txt; }
|
||||
return "unsupported fat speech";
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
|
@ -470,8 +470,8 @@ extras = {
|
||||
"This page was made by Urbit. Feedback: ", a({
|
||||
href: "mailto:urbit@urbit.org"
|
||||
}, "urbit@urbit.org"), " ", a({
|
||||
href: "https://twitter.com/urbit_"
|
||||
}, "@urbit_")
|
||||
href: "https://twitter.com/urbit"
|
||||
}, "@urbit")
|
||||
])
|
||||
]);
|
||||
})
|
||||
@ -1927,6 +1927,9 @@ module.exports = query({
|
||||
},
|
||||
onSubmit: function(e) {
|
||||
var comment, path, title;
|
||||
this.setState({
|
||||
loading: true
|
||||
});
|
||||
title = this.refs["in"].title.value;
|
||||
comment = this.refs["in"].comment.value;
|
||||
path = this.props.path || "/";
|
||||
@ -1939,27 +1942,26 @@ module.exports = query({
|
||||
});
|
||||
},
|
||||
render: function() {
|
||||
var _attr, bodyTextArea, postButton, titleInput;
|
||||
_attr = {};
|
||||
if (this.state.loading === true) {
|
||||
_attr.disabled = "true";
|
||||
}
|
||||
titleInput = input(_.create(_attr, {
|
||||
var bodyTextArea, postButton, titleInput;
|
||||
titleInput = input({
|
||||
disabled: this.state.loading ? "true" : void 0,
|
||||
type: "text",
|
||||
name: "title",
|
||||
placeholder: "Title"
|
||||
}));
|
||||
bodyTextArea = textarea(_.create(_attr, {
|
||||
});
|
||||
bodyTextArea = textarea({
|
||||
disabled: this.state.loading ? "true" : void 0,
|
||||
type: "text",
|
||||
name: "comment",
|
||||
value: this.state.value,
|
||||
onChange: this.onChange
|
||||
}));
|
||||
postButton = input(_.create(_attr, {
|
||||
});
|
||||
postButton = input({
|
||||
disabled: this.state.loading ? "true" : void 0,
|
||||
type: "submit",
|
||||
value: "Post",
|
||||
className: "btn btn-primary"
|
||||
}));
|
||||
});
|
||||
return div({}, div({
|
||||
className: "add-post"
|
||||
}, form({
|
||||
@ -2051,7 +2053,7 @@ Virtual = name("Virtual", function(arg) {
|
||||
}, function(str) {
|
||||
return str;
|
||||
}, function(arg1, key) {
|
||||
var c, e, error, ga, gn, props, ref1;
|
||||
var c, e, ga, gn, props, ref1;
|
||||
gn = arg1.gn, ga = arg1.ga, c = arg1.c;
|
||||
props = {
|
||||
key: key
|
||||
@ -2476,7 +2478,7 @@ module.exports = query({
|
||||
if (this.props.match) {
|
||||
comp = gn === this.props.match;
|
||||
} else {
|
||||
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN;
|
||||
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== (0/0);
|
||||
}
|
||||
if (comp) {
|
||||
ga = _.clone(ga);
|
||||
@ -3164,8 +3166,9 @@ module.exports = {
|
||||
if (hor != null) {
|
||||
d.setHours(hor);
|
||||
d.setMinutes(min);
|
||||
return d.setSeconds(sec);
|
||||
d.setSeconds(sec);
|
||||
}
|
||||
return d;
|
||||
},
|
||||
getKeys: function(kids, sortBy) {
|
||||
return _.map(this.sortKids(kids, sortBy), 'name');
|
||||
@ -3345,8 +3348,12 @@ EventEmitter.prototype.emit = function(type) {
|
||||
er = arguments[1];
|
||||
if (er instanceof Error) {
|
||||
throw er; // Unhandled 'error' event
|
||||
} else {
|
||||
// At least give some kind of context to the user
|
||||
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
|
||||
err.context = er;
|
||||
throw err;
|
||||
}
|
||||
throw TypeError('Uncaught, unspecified "error" event.');
|
||||
}
|
||||
}
|
||||
|
||||
|
3
web/unmark/1.txt
Normal file
3
web/unmark/1.txt
Normal file
@ -0,0 +1,3 @@
|
||||
The quick *brown fox* jumped over #(add 2 2)
|
||||
their owner's "extremely lazy" dogs.
|
||||
|
3
web/unmark/10.txt
Normal file
3
web/unmark/10.txt
Normal file
@ -0,0 +1,3 @@
|
||||
;style:'#test-style {transform: skew(25deg)}'
|
||||
|
||||
### Test style
|
12
web/unmark/11.txt
Normal file
12
web/unmark/11.txt
Normal file
@ -0,0 +1,12 @@
|
||||
;+
|
||||
;>
|
||||
foo *some style*
|
||||
|
||||
outdent
|
||||
|
||||
;= ;div; ==
|
||||
|
||||
;=
|
||||
moar markdown
|
||||
==
|
||||
|
11
web/unmark/2.txt
Normal file
11
web/unmark/2.txt
Normal file
@ -0,0 +1,11 @@
|
||||
The quick brown fox jumped _over
|
||||
the_ extremely lazy dogs.
|
||||
|
||||
Then a horse arrived. It was extremely angry.
|
||||
Outside, two bears [were fighting](http://google.com) each other.
|
||||
|
||||
Also present at the scene were:
|
||||
|
||||
- an Armenian.
|
||||
|
||||
Everything was soon back to normal.
|
52
web/unmark/3.txt
Normal file
52
web/unmark/3.txt
Normal file
@ -0,0 +1,52 @@
|
||||
#(add 2 2) is a hoon expression
|
||||
|
||||
un*bearably*
|
||||
|
||||
0b1100
|
||||
|
||||
---
|
||||
|
||||
|
||||
## This is a header
|
||||
|
||||
The quick brown fox jumped over
|
||||
the extremely lazy dogs.
|
||||
|
||||
Then a horse arrived. It was extremely angry.
|
||||
Outside, two bears [were fighting](http://google.com) each other.
|
||||
|
||||
Also present at _the intense %hoon scene_ were:
|
||||
|
||||
- an Armenian.
|
||||
|
||||
- a haberdasher.
|
||||
|
||||
A haberdasher is someone who makes hats. There are quite
|
||||
a few kinds of hats:
|
||||
|
||||
- fedoras
|
||||
|
||||
- borsalinos
|
||||
|
||||
- sombreros
|
||||
|
||||
- baseball caps
|
||||
|
||||
All these devices will protect your bald spot from the rain.
|
||||
|
||||
It is _sometimes difficult_ to be a bald man when it's raining.
|
||||
|
||||
We sometimes speak in %hoon We also say 0xdead.beef things like ~ and #`@`2.
|
||||
|
||||
We don't care if we sound funny, and sometimes we !@#$%%#^? cuss.
|
||||
|
||||
```
|
||||
We also sometimes put
|
||||
in
|
||||
code
|
||||
looks
|
||||
|
||||
like
|
||||
this.
|
||||
```
|
||||
|
18
web/unmark/4.txt
Normal file
18
web/unmark/4.txt
Normal file
@ -0,0 +1,18 @@
|
||||
## A digital home base
|
||||
|
||||
What you need is a digital home base. What is that computer? Is
|
||||
it (a) your phone, (b) your browser, (c) your PC or laptop, (d)
|
||||
your AWS instance, (e) your RasPi or other custom home computer?
|
||||
|
||||
Here are three obvious features your digital home base needs.
|
||||
(1) it should be infinitely secure and persistent -- at the level
|
||||
of Amazon S3, Gmail, your bank, etc. (2) it should be a server,
|
||||
not just a client. (3) it should be usable by ordinary people.
|
||||
|
||||
Everything except (d) falls far short of (1) and/or (2). (d)
|
||||
falls far short of (3).
|
||||
|
||||
The missing piece is a practical _personal server_ -- a virtual
|
||||
computer in the cloud, with persistence guarantees comparable to
|
||||
cloud storage services, that's as completely yours as a RasPi.
|
||||
|
6
web/unmark/6.txt
Normal file
6
web/unmark/6.txt
Normal file
@ -0,0 +1,6 @@
|
||||
*brown fox* ;{s "ignoreme"} ;{a(name "foo")} jumped over
|
||||
|
||||
;div#test: hello world
|
||||
|
||||
- - foo
|
||||
- bar
|
37
web/unmark/8.txt
Normal file
37
web/unmark/8.txt
Normal file
@ -0,0 +1,37 @@
|
||||
> xyz
|
||||
abc
|
||||
|
||||
```
|
||||
code at the beginning of the line
|
||||
```
|
||||
|
||||
zyxxy
|
||||
|
||||
> bar
|
||||
|
||||
poe
|
||||
m
|
||||
|
||||
> baz
|
||||
> bal
|
||||
|
||||
- - bleh
|
||||
- blah
|
||||
+ one
|
||||
+ two
|
||||
|
||||
1
|
||||
|
||||
> > bel
|
||||
> what did you just say about me
|
||||
|
||||
...
|
||||
|
||||
```
|
||||
code
|
||||
still code?
|
||||
```
|
||||
|
||||
> > foo
|
||||
|
||||
not-code
|
1
web/unmark/9.txt
Normal file
1
web/unmark/9.txt
Normal file
@ -0,0 +1 @@
|
||||
> - + ;div.test: nesting
|
89
web/unmark/all.hoon
Normal file
89
web/unmark/all.hoon
Normal file
@ -0,0 +1,89 @@
|
||||
:: Render all %%/{@u}.txt test cases
|
||||
::
|
||||
:::: /hoon/all/unmark/web
|
||||
::
|
||||
/- down, markdown
|
||||
/+ vast2
|
||||
::
|
||||
/= cor /^ (list {@ud wain})
|
||||
/: /%%/ /_ @ud /txt/
|
||||
/= mad /: /%%/cm-spec /down/
|
||||
::
|
||||
|%
|
||||
++ rolt |=(a/wall `tape`?~(a ~ ?~(t.a i.a :(weld i.a "\0a" $(a t.a)))))
|
||||
++ wush
|
||||
|= {wid/@u tan/tang} ^- tape
|
||||
(rolt (zing (turn tan |=(a/tank (wash 0^wid a)))))
|
||||
::
|
||||
++ mads
|
||||
|= a/wain ^- marl
|
||||
=/ try (mule |.(~(shut ap (rash (nule ';>' a) apex:(sail &):vast2))))
|
||||
?- -.try
|
||||
$& p.try
|
||||
$| ;= ;div
|
||||
;h3: ERROR
|
||||
;pre: {(wush 120 p.try)}
|
||||
== == ==
|
||||
::
|
||||
++ split-on
|
||||
=| hed/wain
|
||||
|= {mid/@t all/wain} ^+ [hed all]
|
||||
?~ all !!
|
||||
?: =(mid i.all) [(flop hed) t.all]
|
||||
$(all t.all, hed :_(hed i.all))
|
||||
::
|
||||
++ strip
|
||||
|= a/manx ^- manx
|
||||
:_ (turn c.a ..$)
|
||||
?+ g.a g.a
|
||||
{@ {$id *} *} g.a(a t.a.g.a)
|
||||
{$$ {$$ *} $~}
|
||||
=< g.a(v.i.a (tufa (turn (tuba v.i.a.g.a) .)))
|
||||
|=(b/@c `@`?+(b b $~-~201c. '"', $~-~201d. '"'))
|
||||
==
|
||||
--
|
||||
::
|
||||
^- manx
|
||||
;ul
|
||||
;li
|
||||
;h2: Core
|
||||
;ul
|
||||
;* ^- marl
|
||||
%+ turn cor
|
||||
|= {num/@u txt/wain}
|
||||
;li: ;{p -[<num>]} *{(mads txt)} ;{hr}
|
||||
==
|
||||
==
|
||||
;li
|
||||
;h2: CommonMark
|
||||
;ol
|
||||
;* ?: [disabled=&] ; DISABLED
|
||||
^- marl
|
||||
%+ murn `down`mad
|
||||
|= a/elem:markdown
|
||||
?: ?=($head -.a)
|
||||
?. ?=({{$$ *} $~} q.a)
|
||||
~
|
||||
(some /(crip "h{<p.a>}") ;"{p.i.q.a}")
|
||||
?. ?=({$code ^ *} a) ~
|
||||
?. =("example" r.u.p.a) ~
|
||||
%- some
|
||||
^- manx
|
||||
|-
|
||||
=+ [inp out]=(split-on '.' q.a)
|
||||
=/ mar c:(snag 0 (mads inp))
|
||||
;li
|
||||
;pre: {(trip (role inp))}
|
||||
;p: =>
|
||||
;pre: {(trip (role out))}
|
||||
;p: vs
|
||||
;pre: {(many:poxo mar "")}
|
||||
;p
|
||||
;- =/ pox (rush (role out) many:poxa)
|
||||
?~ pox "INVALID"
|
||||
?: =(u.pox mar) "EQUIVALENT"
|
||||
?: =(u.pox (turn mar strip)) "COMPATIBLE"
|
||||
"DIVERGE"
|
||||
==
|
||||
== ==
|
||||
== ==
|
9413
web/unmark/cm-spec.md
Normal file
9413
web/unmark/cm-spec.md
Normal file
File diff suppressed because it is too large
Load Diff
348
web/unmark/doc.umd
Normal file
348
web/unmark/doc.umd
Normal file
@ -0,0 +1,348 @@
|
||||
:: :- :* title+"urbit-flavored markdown docs"
|
||||
:: author+"ted blackman"
|
||||
:: date+~2017.8.25
|
||||
:: ==
|
||||
::
|
||||
;>
|
||||
|
||||
# udon: urbit-flavored markdown
|
||||
|
||||
## overview
|
||||
|
||||
Udon is a minimal markup language for creating and rendering text documents,
|
||||
with a markdown-inspired syntax. It's integrated with the hoon programming
|
||||
language, allowing it to be used as standalone prose in its own file or inside
|
||||
a hoon source file, in which case it will be parsed into a tree of HTML nodes
|
||||
using hoon's `sail` datatype.
|
||||
|
||||
Udon is stricter than markdown and generally supports only one syntax for each
|
||||
type of HTML node it emits.
|
||||
|
||||
### headers
|
||||
|
||||
Headers in udon begin with one or more `#` characters, followed by a space. The
|
||||
number of leading `#`s corresponds to the resulting HTML element: `#` yields an
|
||||
`<h1>`, `##` yields an `<h2>`, and so on through `<h6>`.
|
||||
|
||||
Example:
|
||||
```
|
||||
### Header (h3)
|
||||
|
||||
##### Header (h5)
|
||||
```
|
||||
produces:
|
||||
|
||||
> ### Header (h3)
|
||||
|
||||
##### Header (h5)
|
||||
|
||||
### lists
|
||||
|
||||
A line beginning with a `-` or `+` followed by a space is interpreted as an
|
||||
element of a list. `-` means unordered list (`<ul>`) and `+` means ordered list
|
||||
(`<ol>`).
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
- unordered 1
|
||||
text on newline shows up on same line
|
||||
- unordered 2\
|
||||
text on newline after `\` puts in <br> line break
|
||||
|
||||
- unordered after 1 blank line
|
||||
- nested
|
||||
- double-nested
|
||||
|
||||
+ leading '+'
|
||||
+ leading '+'
|
||||
- unordered '-'
|
||||
+ nested ordered '+' item 1
|
||||
+ nested ordered '+' item 2
|
||||
|
||||
+ ordered '+'
|
||||
+ nested item 1
|
||||
+ nested item 2
|
||||
```
|
||||
|
||||
produces:
|
||||
|
||||
> - unordered 1
|
||||
text on newline shows up on same line
|
||||
- unordered 2\
|
||||
text on newline after `\` puts in <br> line break
|
||||
|
||||
- unordered after 1 blank line
|
||||
- nested
|
||||
- double-nested
|
||||
|
||||
+ leading '+'
|
||||
+ leading '+'
|
||||
- unordered '-'
|
||||
+ nested ordered '+' item 1
|
||||
+ nested ordered '+' item 2
|
||||
|
||||
+ ordered '+'
|
||||
+ nested item 1
|
||||
+ nested item 2
|
||||
|
||||
### blockquotes
|
||||
|
||||
A section of text beginning with `> ` and indented by two spaces yields a
|
||||
`<blockquote>` element. This blockquote can itself turn contain more udon,
|
||||
including more blockquotes to render nested levels of quotation.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
> As Gregor Samsa awoke one morning from uneasy dreams
|
||||
he found himself _transformed_ in his bed into a *monstrous* vermin.
|
||||
```
|
||||
|
||||
produces:
|
||||
|
||||
> > As Gregor Samsa awoke one morning from uneasy dreams
|
||||
he found himself _transformed_ in his bed into a *monstrous* vermin.
|
||||
|
||||
### code blocks
|
||||
|
||||
By enclosing a block of text in `\`\`\` on their own lines
|
||||
before and after the block, the text will be treated as a code block.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
> ```
|
||||
(def Y (fn [f]
|
||||
((fn [x]
|
||||
(x x))
|
||||
(fn [x]
|
||||
(f (fn [y]
|
||||
((x x) y)))))))
|
||||
```
|
||||
```
|
||||
|
||||
produces:
|
||||
|
||||
> ```
|
||||
(def Y (fn [f]
|
||||
((fn [x]
|
||||
(x x))
|
||||
(fn [x]
|
||||
(f (fn [y]
|
||||
((x x) y)))))))
|
||||
```
|
||||
|
||||
### poems
|
||||
|
||||
A poem is a section of text with meaningful newlines. Normally in udon,
|
||||
newlines are treated as spaces and do not create a new line of text. If you
|
||||
want to embed text where newlines are retained, then indent the text by
|
||||
question with eight spaces.
|
||||
|
||||
Example:
|
||||
```
|
||||
A shape with lion body and the head of a man,
|
||||
A gaze blank and pitiless as the sun,
|
||||
Is moving its slow thighs, while all about it
|
||||
Reel shadows of the indignant desert birds.
|
||||
```
|
||||
produces:
|
||||
> A shape with lion body and the head of a man,
|
||||
A gaze blank and pitiless as the sun,
|
||||
Is moving its slow thighs, while all about it
|
||||
Reel shadows of the indignant desert birds.
|
||||
|
||||
### sail expressions
|
||||
|
||||
It's possible to use udon as an HTML templating language akin to
|
||||
PHP, ERB, JSP, or Handlebars templates. This facility derives
|
||||
in part from the support for embedding hoon code inside the markup.
|
||||
There are two ways to do embed hoon in udon: inline expressions and sail.
|
||||
[Sail](https://urbit.org/fora/posts/~2017.7.6..21.27.00..bebb~/)
|
||||
is a DSL within hoon for creating XML nodes, including HTML. It can
|
||||
be used directly within udon to provide scripting capability and also to
|
||||
provide more fine-grained control over the resulting HTML.
|
||||
|
||||
Example:
|
||||
```
|
||||
;=
|
||||
;p
|
||||
;strong: Don't panic!
|
||||
;br;
|
||||
;small: [reactive publishing intensifies]
|
||||
==
|
||||
==
|
||||
```
|
||||
|
||||
produces:
|
||||
> ;=
|
||||
;p
|
||||
;strong: Don't panic!
|
||||
;br;
|
||||
;small: [reactive publishing intensifies]
|
||||
==
|
||||
==
|
||||
|
||||
_Note:
|
||||
[urbit's web publishing system](https://urbit.org/docs/arvo/web-apps/)
|
||||
currently does not apply `<style>` elements or element attributes,
|
||||
which are supported in sail syntax. Future versions of the publishing
|
||||
system will rectify this._
|
||||
|
||||
### horizontal rules
|
||||
|
||||
`---` on its own line produces an `<hr>` element, the 'horizontal rule'.
|
||||
This is rendered as a horizontal line the width of its containing paragraph.
|
||||
|
||||
Example:
|
||||
```
|
||||
Above the line
|
||||
---
|
||||
Below the line
|
||||
```
|
||||
> :: produces:\
|
||||
Above the line
|
||||
---
|
||||
Below the line
|
||||
|
||||
### inline markup
|
||||
|
||||
In addition to the above, udon includes several options for marking up
|
||||
inline text.
|
||||
|
||||
##### bold
|
||||
|
||||
Enclose some text in asterisks to boldly render it inside a `<b>` element.
|
||||
|
||||
Example:
|
||||
```
|
||||
The first rule of tautology club is
|
||||
*the first rule of tautology club*.
|
||||
```
|
||||
produces:\
|
||||
|
||||
> The first rule of tautology club is
|
||||
*the first rule of tautology club*.
|
||||
|
||||
##### italics
|
||||
|
||||
Surrounding text with `_` on each side will cause it to appear
|
||||
in italics, using an <i> element.
|
||||
|
||||
Example:
|
||||
```
|
||||
Bueller? _Bueller?_
|
||||
```
|
||||
|
||||
produces:
|
||||
|
||||
Bueller? _Bueller?_
|
||||
|
||||
##### double quote
|
||||
|
||||
Text enclosed in double quotes (`"`) will be rendered with
|
||||
opening and closing quotes.
|
||||
|
||||
Example:
|
||||
```
|
||||
"Yes," he said. "That is the way with him."
|
||||
```
|
||||
produces:\
|
||||
|
||||
"Yes," he said. "That is the way with him."
|
||||
|
||||
##### backslash escape
|
||||
|
||||
A backslash directly before a word (with no spaces) will be interpreted
|
||||
as an escape character, causing it to be rendered raw.
|
||||
|
||||
Example:
|
||||
```
|
||||
Here is some *bold* text.
|
||||
Here is some \*not bold\* text.
|
||||
```
|
||||
produces:
|
||||
|
||||
Here is some *bold* text.
|
||||
Here is some \*not bold\* text.
|
||||
|
||||
##### trailing backslash
|
||||
|
||||
A backslash at the end of a line inserts a line break (`<br>`)
|
||||
after that line. This contrasts with the normal udon behavior of
|
||||
converting newlines to spaces.
|
||||
|
||||
Example:
|
||||
```
|
||||
I wonder how long each line
|
||||
will be if I put backslashes\
|
||||
at the ends of the lines.
|
||||
```
|
||||
produces:
|
||||
|
||||
I wonder how long each line
|
||||
will be if I put backslashes\
|
||||
at the ends of the lines.
|
||||
|
||||
##### inline code literal
|
||||
|
||||
Enclosing some text in ``` characters will cause it to be displayed as code,
|
||||
inside a <code> element with monospace font and a different background color.
|
||||
|
||||
Example:
|
||||
```
|
||||
`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
|
||||
```
|
||||
produces:\
|
||||
|
||||
`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
|
||||
|
||||
Also, using the `++` prefix before a word will cause the word
|
||||
to be rendered as code, since that's the standard notation
|
||||
for an arm in hoon.
|
||||
|
||||
Example:
|
||||
```
|
||||
The udon parser is part of ++vast.
|
||||
```
|
||||
produces:\
|
||||
|
||||
The udon parser is part of ++vast.
|
||||
|
||||
##### hoon constants
|
||||
|
||||
Hoon has several syntactic forms for literals (numbers, strings, dates, etc.)
|
||||
that can be used in udon as well. They will appear inside a <code> element like
|
||||
inline code.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
~2017.8.29 \
|
||||
0xdead.beef \
|
||||
%term
|
||||
```
|
||||
|
||||
produces:\
|
||||
|
||||
~2017.8.29 \
|
||||
0xdead.beef \
|
||||
%term
|
||||
|
||||
##### url
|
||||
|
||||
To insert a hyperlink, put the text content of the link in `[]` brackets
|
||||
followed by the destination URL in `()` parentheses. Note that the text
|
||||
of the displayed link can contain markdown styling.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
A [hoon `core`](https://urbit.org/docs/hoon/concepts/#-core-object)
|
||||
is similar to an object in a traditional programming langauge.
|
||||
```
|
||||
produces:\
|
||||
|
||||
A [hoon `core`](https://urbit.org/docs/hoon/concepts/#-core-object)
|
||||
is similar to an object in a traditional programming langauge.
|
8
web/unmark/test.hoon
Normal file
8
web/unmark/test.hoon
Normal file
@ -0,0 +1,8 @@
|
||||
:- ;>
|
||||
indented
|
||||
indented
|
||||
|
||||
:- ;= ;>
|
||||
==
|
||||
;= ;> some *markdown*
|
||||
==
|
Loading…
Reference in New Issue
Block a user