Add special cases for %da and %ta to +slaw
+slav calls +slaw with %da and %ta in several places across multiple
vanes. This refactors the date parsing code into its own arm so it
can be called from +slaw.
++ crub
~+
;~ pose
- %+ cook
- |=(det/date `dime`[%da (year det)])
- ;~ plug
- %+ cook
- |=({a/@ b/?} [b a])
- ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
- ;~(pfix dot mot:ag) :: month
- ;~(pfix dot dip:ag) :: day
- ;~ pose
- ;~ pfix
- ;~(plug dot dot)
- ;~ plug
- dum:ag
- ;~(pfix dot dum:ag)
- ;~(pfix dot dum:ag)
- ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
- ==
- ==
- (easy [0 0 0 ~])
- ==
- ==
+ (cook |=(det/date `dime`[%da (year det)]) when)
::
%+ cook
|= {a/(list {p/?($d $h $m $s) q/@}) b/(list @)}
(stag %$ crub)
==
::
+ ++ when
+ ~+
+ ;~ plug
+ %+ cook
+ |=({a/@ b/?} [b a])
+ ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
+ ;~(pfix dot mot:ag) :: month
+ ;~(pfix dot dip:ag) :: day
+ ;~ pose
+ ;~ pfix
+ ;~(plug dot dot)
+ ;~ plug
+ dum:ag
+ ;~(pfix dot dum:ag)
+ ;~(pfix dot dum:ag)
+ ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
+ ==
+ ==
+ (easy [0 0 0 ~])
+ ==
+ ==
+ ::
++ zust
~+
;~ pose
::
=+ con=(slay txt)
?.(&(?=({~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
+ ::
+ %da
+ (rush txt ;~(pfix sig (cook year when:so)))
::
%p
(rush txt ;~(pfix sig fed:ag))
::
%uv
(rush txt ;~(pfix (jest '0v') viz:ag))
+ ::
+ %ta
+ (rush txt ;~(pfix ;~(plug sig dot) urs:ab))
::
%tas
(rush txt sym)
