-s ::= {Doc} => top
-
-Doc ::= Header Body /ws => doc
-Header ::= "header" { kv */ ws } /ws => header
-Body ::= Section*/ws => body
-Section ::= SectionHeader Paragraph*/ws /ws => section
-SectionHeader ::= "==" SectionHeaderBody "=="
-SectionHeaderBody ::= "=" SectionHeaderBody "="
- > ws text 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 => "t"
-itemx ::= ws item => "w" | ()
-item ::= blockquote => "b"
- > pre itemx => "a"
- > structured itemx => "1"
- > structuredx itemx => "2"
- > styled itemx => "3"
- > qtext itemx => "4"
- > alphanum++ itemx => "5"
- > symbol itemx => "6"
-// > sym++ itemx => []
- > Paragraph itemx => "7"
-
-symbol ::= sym++
-
-blockquote ::= "\"\"" text "\"\"" => "blockquote"
- | "\"\"" block => "blockquote"
+s = Doc
+
+Doc = head:Header body:Body /ws
+Header = H:: { "header" { KeyVal */ ws } /ws }
+Body = B:: {Section}*/ws
+Section = SectionHeader Paragraph* /ws
+SectionHeader = "==" SectionHeaderBody "=="
+SectionHeaderBody = "=" SectionHeaderBody "="
+ > ws! alphanum++ ws!
+
+sp = " "**
+blank = sp! "\n" sp! "\n" ws!
+
+KeyVal = key:word "=" val:text /ws
+wp = w++
+num = [0-9]++
+
+Paragraph = Blockquote:: { "\"\" " text }
+ > HR:: { "---" "-"* }
+ > P:: { text }
+
+onums = nums (". "|") ")!
+any = ~[]*
+
+uli = "* " (ws! text &~ any (oli|uli)!)
+oli = ("# "|onums)! (ws! text &~ any (oli|uli)!)
+
+text = Item
+Itemx = ws! Item
+ | ()
+Item =
+// "[]":: blockquote Itemx
+// >
+ "[]":: { UL:: uli+/ws } Itemx
+ | "[]":: { OL:: oli+/ws } Itemx
+ > "[]":: pre Itemx
+ > "[]":: link Itemx
+ > "[]":: structured Itemx
+ > "[]":: styled Itemx
+ > "[]":: (Chars:: alphanum++) Itemx
+ > "[]":: "\"" text "\"" Itemx
+ > "[]":: (Symbol:: sym++) Itemx
+ > "[]":: { Block:: text } Itemx
+
+//blockquote = Blockquote:: "\"\"" (block | text "\"\"")