-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 = Doc
+
+Doc = Doc:: head:{Header} body:Body /ws
+Header = Header:: "header" attrs:{ kv */ ws } /ws
+Body = Body:: sections:(Section*/ws)
+Section = { Section:: header:SectionHeader paragraphs:Paragraph* /ws }
+SectionHeader = "==" SectionHeaderBody "=="
+SectionHeaderBody = "=" SectionHeaderBody "="
+ > !ws (Chars:: text:alphanum++) !ws
+
+sp = " "**
+blank = !sp "\n" !sp "\n" !ws
+
+
+kv = kv:: key:word "=" val:text /ws
+wp = w++
+num = [0-9]++
+Paragraph = Blockquote:: { "\"\" " text }
+ > HR:: { "---" "-"* }
+ > { P:: t:text }
+
+onums = nums !(". "|") ")
+any = ~[]*
+
+uli = "* " (!ws text &~ any (oli|uli))
+oli = !("# "|onums) (!ws text &~ any (oli|uli))
+
+text = Item
+Itemx = !ws Item
+ | ()
+Item = blockquote
+ > "[]":: { UL:: uli+/ws } Itemx
+ | "[]":: { OL:: oli+/ws } Itemx
+ > "[]":: pre Itemx
+ > "[]":: link Itemx
+ > "[]":: structured Itemx
+ > "[]":: styled Itemx
+ > "[]":: (Chars:: text:alphanum++) Itemx
+ > "[]":: "\"" text "\"" Itemx
+ > "[]":: symbol Itemx
+ > "[]":: (Symbol:: sym++) Itemx
+ > "[]":: Paragraph Itemx
+
+blockquote = Blockquote:: "\"\"" text "\"\""
+ | Blockquote:: "\"\"" block