Fix some error handling issues.

This commit is contained in:
C. Guy Yarvin 2015-03-27 12:43:27 -07:00
parent c35e6f4f30
commit 589b2d7101
4 changed files with 25 additions and 33 deletions

View File

@ -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))
==

View File

@ -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 ::

View File

@ -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

View File

@ -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 ~)
==