-s ::= Doc => top
-
-Doc ::= {Header} Body /ws => doc
-Header ::= "header" { kv */ ws } /ws => header
-Body ::= Section*/ws => body
-Section ::= { SectionHeader Paragraph* /ws => section }
-SectionHeader ::= "==" SectionHeaderBody "=="
-SectionHeaderBody ::= "=" SectionHeaderBody "="
- > ws text ws
-
-sp !::= " "**
-blank ::= sp "\n" sp "\n" ws
-
-kv ::= word "=" text /ws => kv1
-
-num !::= [0-9]++
-Paragraph ::= { "\"\"" ws text } => "blockquote"
- > { "*" " " ws text } => "ul"
- > { "#" " " ws text } => "ol"
- > { num " " ws text } => "ol"
- > { "---" "-"* } => "hr"
- > { text } => "p"
-
-text ::= Item
-Itemx ::= ws Item | ()
-Item ::= blockquote
- > pre Itemx => []
- > structured Itemx => []
- > structuredx Itemx => []
- > styled Itemx => []
- > qtext Itemx => []
- > (alphanum++ => stringify) Itemx => []
- > symbol Itemx => []
-// > sym++ Itemx => []
- > Paragraph Itemx => []
-
-symbol ::= sym++
-
-blockquote ::= "\"\"" text "\"\"" => "blockquote"
- | "\"\"" block => "blockquote"
+s = top:: Doc
+
+Doc = doc:: {Header} Body /ws
+Header = header:: "header" { kv */ ws } /ws
+Body = body:: Section*/ws
+Section = { section:: SectionHeader Paragraph* /ws }
+SectionHeader = "==" SectionHeaderBody "=="
+SectionHeaderBody = "=" SectionHeaderBody "="
+ > !ws text !ws
+
+sp = " "**
+blank = !sp "\n" !sp "\n" !ws
+
+kv = kv1:: word "=" text /ws
+wp = w++
+num = [0-9]++
+Paragraph = blockquote:: { "\"\"" !ws text }
+ > hr:: { "---" "-"* }
+ > p:: { text }
+
+onums = nums !(". "|") ")
+any = ~[]*
+
+uli = li:: "* " (!ws text &~ any (oli|uli))
+oli = li:: ("# "|onums) (!ws text &~ any (oli|uli))
+
+//
+
+text = text:: Item
+Itemx = !ws Item
+ | ()
+Item = blockquote
+ > "[]":: { ul:: uli+/ws } Itemx
+ | "[]":: { ol:: oli+/ws } Itemx
+ > "[]":: pre Itemx
+ > "[]":: structured Itemx
+ > "[]":: structuredx Itemx
+ > "[]":: styled Itemx
+ > "[]":: qtext Itemx
+ > "[]":: (stringify:: alphanum++) Itemx
+ > "[]":: symbol Itemx
+ > "[]":: (stringify:: sym++) Itemx
+ > "[]":: Paragraph Itemx
+
+blockquote = blockquote:: "\"\"" text "\"\""
+ | blockquote:: "\"\"" block