From 05a39ac52f0a3dd28778a7c47b107953bb9c00c9 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 10 Oct 2014 14:16:19 -0700 Subject: [PATCH] Tank hax! --- arvo/hoon.hoon | 16 ++++++++-------- arvo/zuse.hoon | 2 +- main/app/terminal/core.hook | 26 ++++++++++++++++++-------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 4dd41f845f..eb37b46ac5 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -844,7 +844,7 @@ :: ++ can :: assemble ~/ %can - |= [a=bloq b=(list ,[p=@ q=@])] + |= [a=bloq b=(list ,[p=@u q=@])] ^- @ ?~ b 0 (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b))) @@ -856,16 +856,16 @@ :: ++ cut :: slice ~/ %cut - |= [a=bloq [b=@ c=@] d=@] + |= [a=bloq [b=@u c=@u] d=@] (end a c (rsh a b d)) :: ++ end :: tail ~/ %end - |= [a=bloq b=@ c=@] + |= [a=bloq b=@u c=@] (mod c (bex (mul (bex a) b))) :: ++ fil :: fill bloqstream - |= [a=bloq b=@ c=@] + |= [a=bloq b=@u c=@] =+ n=0 =+ d=c |- ^- @ @@ -875,7 +875,7 @@ :: ++ lsh :: left-shift ~/ %lsh - |= [a=bloq b=@ c=@] + |= [a=bloq b=@u c=@] (mul (bex (mul (bex a) b)) c) :: ++ met :: measure @@ -912,7 +912,7 @@ :: ++ rsh :: right-shift ~/ %rsh - |= [a=bloq b=@ c=@] + |= [a=bloq b=@u c=@] (div c (bex (mul (bex a) b))) :: ++ swap |=([a=bloq b=@] (rep a (flop (rip a b)))) :: reverse bloq order @@ -1139,12 +1139,12 @@ /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes' |% ++ ind ~/ %ind - |= a=@ + |= a=@tas =+ b=0 |- ^- (unit ,@) ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b)))) ++ ins ~/ %ins - |= a=@ + |= a=@tas =+ b=0 |- ^- (unit ,@) ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b)))) diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index bc9d979745..1670c24f79 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2193,7 +2193,7 @@ ++ dlab :: 2396 domainlabel %+ sear |= a=@ta - ?.(=('-' (rsh 3 a (dec (met 3 a)))) [~ u=a] ~) + ?.(=('-' (rsh 3 (dec (met 3 a)) a)) [~ u=a] ~) %+ cook cass ;~(plug aln (star alp)) :: diff --git a/main/app/terminal/core.hook b/main/app/terminal/core.hook index 8db0791669..3e76628529 100644 --- a/main/app/terminal/core.hook +++ b/main/app/terminal/core.hook @@ -166,7 +166,8 @@ case 13: // %retn if(e.shiftKey) return true v = prom.val().replace(/\xa0/g, ' ') - cont.textContent += '\n' + prem.textContent + '\n' + v + $(cont).append($('').html(prem.innerHTML), + $('').text(v)) jpok('line', v) hist.unshift(v) @@ -214,7 +215,16 @@ if(dat.data.ok) return; hist = dat.data.history hind = 0 - cont.textContent = dat.data.lines.join('\n') + cont.innerHTML = '' + for(var i in dat.data.lines){ + var lom = dat.data.lines[i] + if(typeof lom == 'string') + $(cont).append($('
').text(lom)) + else { + $(cont).append($('').html(lom.prompt).append('> '), + $('').text(lom.task)) + } + } window.scrollTo(0,document.body.scrollHeight) prem.textContent = dat.data.prompt + '> ' }) @@ -282,7 +292,7 @@ (spam pax) :: %line - =. r.tel :_(r.tel leaf/"{(trip p.tel)}> {(trip p.jof)}") + =. r.tel :_(r.tel rose/["> " ~ ~]^~[leaf/(trip p.tel) leaf/(trip p.jof)]) =. hiz (~(put by hiz) pax tel) ?: =('\\' (end 3 1 p.jof)) $(jof [%cmd (rsh 3 1 p.jof)]) @@ -356,10 +366,10 @@ :~ [%prompt %s p.tel] [%history %a (turn q.tel |=(a=cord [%s a]))] :+ %lines %a - %- turn :_ jape - ^- wall %- zing - ^- (list wall) - %- flop - (turn r.tel (cury wash 0 80)) + %- zing ^- (list (list json)) + %- flop %+ turn r.tel |= a=tank + ?. ?=([%rose [[%'>' %' ' ~] ~ ~] [%leaf *] [%leaf *] ~] a) + (turn (wash 0^80 a) jape) + [(jobe prompt/(jape p.i.q.a) task/(jape p.i.t.q.a) ~)]~ == --