From 589b2d7101b1fe0997199ed88333f6c041f60f13 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 27 Mar 2015 12:43:27 -0700 Subject: [PATCH] Fix some error handling issues. --- arvo/hoon.hoon | 25 +++++-------------------- arvo/zuse.hoon | 5 +++-- main/app/dojo/core.hook | 12 ++++++------ main/app/sole/core.hook | 16 +++++++++++----- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index b1decc6421..7524120ec7 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -2860,13 +2860,13 @@ :: section 2eI, parsing (external) :: :: ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) :: -++ ruse |* [los=tape sab=_rule] - =+ vex=(sab [[0 0] los]) +++ rose |* [los=tape sab=_rule] + =+ vex=(sab [[1 1] los]) =+ len=(lent los) - ?. =(len q.p.vex) [%| p=q.p.vex] + ?. =(+(len) q.p.vex) [%| p=(dec q.p.vex)] ?~ q.vex - [%| p=len] - [%& p=p.u.q.vex] + [%& p=~] + [%& p=[~ u=p.u.q.vex]] ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab)) ++ rust |* [los=tape sab=_rule] =+ vex=((full sab) [[1 1] los]) @@ -8973,21 +8973,6 @@ (stag %bccm ;~(pfix com hill)) :- '^' ;~ pose - ;~ pfix ket - ;~ pose - ;~ pfix col - %+ sear - |= [a=tile b=twig] :: XX shd be static - =+ rev=(plex b) - ?~ rev ~ - %- some - :+ %smsm a - [%dtkt %dtzz %$ %cx u.rev] - ;~(plug hill rood) - == - (sear prey (most ket rood)) - == - == (stag %cnzz rope) (stag %bczp (cold %cell ket)) == diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 484f133ea0..768d3d87a5 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2206,8 +2206,7 @@ == -- :: -++ epur :: url/header parser - =< |=(a=cord `(unit purl)`(rush a auri)) +++ urlp :: url/header parser |% ++ apat :: 2396 abs_path %+ cook deft @@ -2306,6 +2305,8 @@ (stag %| ;~(plug apat yque)) == -- +++ epur :: url/header parser + =>(urlp |=(a=cord `(unit purl)`(rush a auri))) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 3bH, names etc :: diff --git a/main/app/dojo/core.hook b/main/app/dojo/core.hook index 0c3a6f2e77..13c33349bb 100644 --- a/main/app/dojo/core.hook +++ b/main/app/dojo/core.hook @@ -195,11 +195,11 @@ ++ dp-build :: ++dojo-build %+ knee *dojo-build |. ~+ ;~ pose - (ifix [sel ser] (stag %tu (most ace dp-source))) - ;~(pfix col (stag %di dp-model-gun)) + ;~(pfix wut (stag %di dp-model-gun)) ;~(pfix pam (stag %sc dp-model-sic)) ;~(pfix buc (stag %va sym)) (stag %ex dp-twig) + (ifix [sel ser] (stag %tu (most ace dp-source))) == :: ++ dp-goal :: ++goal @@ -215,7 +215,7 @@ ++ dp-model-sic ;~(plug dp-server-sic dp-config) :: ++dojo-model ++ dp-server-gun (stag 0 (stag %gun dp-device)) :: ++dojo-server ++ dp-server-sic (stag 0 (stag %sic dp-device)) :: ++dojo-server - ++ dp-twig long:(vang & ~) :: ++twig + ++ dp-twig wide:(vang & ~) :: ++twig ++ dp-device (most fas sym) :: ++dojo-device ++ dp-value :: ++dojo-source %+ cook |=(a=dojo-source a) @@ -524,9 +524,9 @@ ++ he-dope :: sole user of ++dp |= txt=tape :: ^- (each (unit dojo-command) hair) :: prefix/result - =+ vex=(dp-command:dp [0 0] txt) :: - ?. =((lent txt) q.p.vex) :: fully parsed - [%| p.vex] :: syntax error + =+ vex=(dp-command:dp [1 1] txt) :: + ?. =(+((lent txt)) q.p.vex) :: fully parsed + [%| p.p.vex (dec q.p.vex)] :: syntax error [%& ?~(q.vex ~ `p.u.q.vex)] :: prefix/complete :: ++ he-duke :: ++he-dope variant diff --git a/main/app/sole/core.hook b/main/app/sole/core.hook index f49957401d..97e7529904 100644 --- a/main/app/sole/core.hook +++ b/main/app/sole/core.hook @@ -415,11 +415,14 @@ .(+> (se-blit %bel ~)) (ta-hom %del pos.inp) :: - ++ ta-err :: hear error + ++ ta-erl :: hear local error |= pos=@ud - =. pos (~(transpose cs say.inp) pos) ta-bel(pos.inp (min pos (lent buf.say.inp))) :: + ++ ta-err :: hear remote error + |= pos=@ud + (ta-erl (~(transpose cs say.inp) pos)) + :: ++ ta-fec :: apply effect |= fec=console-effect ^+ +> @@ -508,10 +511,13 @@ ++ ta-ret :: hear return ?. mav (ta-act %ret ~) - =+ fey=(ruse (tufa buf.say.inp) sp-ukase:sp) + =+ txt=(tufa buf.say.inp) + =+ fey=(rose txt sp-ukase:sp) ?- -.fey - %| (ta-err p.fey) - %& =. +>+ (se-like p.fey) + %| (ta-erl (lent (tuba (scag p.fey txt)))) + %& ?~ p.fey + (ta-erl (lent buf.say.inp)) + =. +>+> (se-like u.p.fey) =. pom pom.tar.maz (ta-hom:ta-nex %set ~) ==