mirror of
https://github.com/urbit/shrub.git
synced 2024-12-14 20:02:51 +03:00
End parsing cram on outdent
This commit is contained in:
parent
108f8079af
commit
6985398293
@ -334,8 +334,7 @@
|
|||||||
sty/trig-style :: style
|
sty/trig-style :: style
|
||||||
== ::
|
== ::
|
||||||
++ trig-style ::
|
++ trig-style ::
|
||||||
$? $fini :: terminator
|
$? $done :: end of input
|
||||||
$done :: end of input
|
|
||||||
$rule :: --- horizontal ruler
|
$rule :: --- horizontal ruler
|
||||||
$lint :: + line item
|
$lint :: + line item
|
||||||
$lite :: - line item
|
$lite :: - line item
|
||||||
@ -390,7 +389,7 @@
|
|||||||
::
|
::
|
||||||
++ cram-main :: parsing loop logic
|
++ cram-main :: parsing loop logic
|
||||||
=* parse cram-parsers
|
=* parse cram-parsers
|
||||||
|= {col/@u naz/hair los/tape}
|
|= {top/@u naz/hair los/tape}
|
||||||
::
|
::
|
||||||
:: state of the parsing loop. we maintain a construction
|
:: state of the parsing loop. we maintain a construction
|
||||||
:: stack for elements and a line stack for lines in the
|
:: stack for elements and a line stack for lines in the
|
||||||
@ -405,6 +404,7 @@
|
|||||||
:: lub: current block being read in
|
:: lub: current block being read in
|
||||||
::
|
::
|
||||||
=| err/(unit hair)
|
=| err/(unit hair)
|
||||||
|
=/ col top
|
||||||
=| hac/(list item)
|
=| hac/(list item)
|
||||||
=/ cur/item [%down ~]
|
=/ cur/item [%down ~]
|
||||||
=| lub/(unit (pair hair (list tape)))
|
=| lub/(unit (pair hair (list tape)))
|
||||||
@ -598,15 +598,9 @@
|
|||||||
=> .(pic u.pic)
|
=> .(pic u.pic)
|
||||||
::
|
::
|
||||||
:: if end of input, complete
|
:: if end of input, complete
|
||||||
?: ?=($done sty.pic)
|
?: |(?=($done sty.pic) (lth col.pic top))
|
||||||
..$(q.naz col.pic)
|
..$(q.naz col.pic)
|
||||||
::
|
::
|
||||||
:: if end marker behind current column
|
|
||||||
?: &(?=($fini sty.pic) (lth col.pic col))
|
|
||||||
::
|
|
||||||
:: retract and complete
|
|
||||||
(back(q.naz (add 2 col.pic)) col.pic)
|
|
||||||
::
|
|
||||||
:: bal: inspection copy of lub, current section
|
:: bal: inspection copy of lub, current section
|
||||||
=/ bal lub
|
=/ bal lub
|
||||||
::
|
::
|
||||||
@ -677,7 +671,7 @@
|
|||||||
::
|
::
|
||||||
++ apse ^+ . :: by prefix style
|
++ apse ^+ . :: by prefix style
|
||||||
?- sty.pic
|
?- sty.pic
|
||||||
?($fini $done) !! :: terminator
|
$done !! :: blank
|
||||||
$rule (push %rule) :: horizontal ruler
|
$rule (push %rule) :: horizontal ruler
|
||||||
$head (push %head) :: heading
|
$head (push %head) :: heading
|
||||||
$bloc (entr %bloc) :: blockquote line
|
$bloc (entr %bloc) :: blockquote line
|
||||||
@ -734,7 +728,6 @@
|
|||||||
;~ pose
|
;~ pose
|
||||||
(full (easy %done)) :: end of input
|
(full (easy %done)) :: end of input
|
||||||
(cold ~ (just `@`10)) :: blank line
|
(cold ~ (just `@`10)) :: blank line
|
||||||
(cold %fini bas) :: terminator
|
|
||||||
(cold %rule ;~(plug hep hep hep)) :: --- horizontal ruler
|
(cold %rule ;~(plug hep hep hep)) :: --- horizontal ruler
|
||||||
(cold %head ;~(plug (star hax) ace)) :: # heading
|
(cold %head ;~(plug (star hax) ace)) :: # heading
|
||||||
(cold %lite ;~(plug hep ace)) :: - line item
|
(cold %lite ;~(plug hep ace)) :: - line item
|
||||||
@ -983,7 +976,7 @@
|
|||||||
%- star
|
%- star
|
||||||
;~ pfix gay
|
;~ pfix gay
|
||||||
;~ pose
|
;~ pose
|
||||||
cram
|
:(cook poxo freeze cram)
|
||||||
;~(sfix ;~(less hrul:cram-parsers (star prn)) (just '\0a'))
|
;~(sfix ;~(less hrul:cram-parsers (star prn)) (just '\0a'))
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
|
Loading…
Reference in New Issue
Block a user