formalize %poem as an indent-based style
$lite :: - line item
$head :: # heading
$bloc :: > block-quote
+ $poem :: [ ]{8} poem
== == ::
{$old $text} :: anything else
== ::
:: if column has retreated, adjust stack
=. +>.$ ?. (lth col.saw inr.ind) +>.$ (back col.saw)
::
- :: dif: columns advanced
- :: erp: error position
+ =^ val sty.saw
+ ?+ (sub col.saw inr.ind) [| sty.saw] :: columns advanced
+ $0 [& sty.saw]
+ $8 [& %new %poem]
+ ==
+ ?. val +>.$(err `[p.loc col.saw])
::
- =/ dif (sub col.saw inr.ind)
- =/ erp [p.loc col.saw]
=. inr.ind col.saw
::
:: execute appropriate paragraph form
..$(par `[loc ~])
::
++ apex ^+ . :: open container
- ?: =(8 dif) (push %poem) :: verse literal
- ?. =(0 dif) fail :: bad indentation
?- +.sty.saw
$done !! :: blank
$dent !! :: outdent
$stet !! :: ==
+ $poem (push %poem) :: verse literal
$head (push %head) :: heading
$bloc (entr %bloc) :: blockquote line
$lite (lent %list) :: unnumbered list
$text text :: anything else
==
::
- ++ fail .(err `erp) :: set error position
++ push :: push context
|=(mite +>(hac [cur hac], cur [+< ~]))
++ entr :: enter container
^+ +>
:: can't switch list types
?: =(?-(ord $list %lord, $lord %list) p.cur)
- fail
+ +>(err `[p.loc inr.ind]) :: set error position
::
:: push list item
=< (entr %lime)
