-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
-wp !::= w++
-num !::= [0-9]++
-Paragraph ::= { "\"\"" ws text } => "blockquote"
- > uli+/ws => "ul"
- > { "# " text } => "ol"
- > { num " " ws text } => "ol"
- > { "---" "-"* } => "hr"
- > { text } => "p"
-uli ::= { "* " text } => "li"
-
-text ::= Item => text
-Itemx ::= ws Item
- | ()
-Item ::= blockquote
- > pre Itemx => []
- > structured Itemx => []
- > structuredx Itemx => []
- > styled Itemx => []
- > qtext Itemx => []
- > (alphanum++ => stringify) Itemx => []
- > symbol Itemx => []
- > (sym++ => stringify) Itemx => []
- > Paragraph => ""
- > Paragraph Itemx => []
-
-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 ws! (Paragraph Paragraph)
+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
+
+Item*/ws =
+ blockquote
+ > { UL:: uli+/ws }
+ | { OL:: oli+/ws }
+ > pre
+ > link
+ > structured
+ > styled
+ > (Chars:: alphanum++)
+ > "\"" text "\""
+ > (Symbol:: sym++)
+// > { Block:: text }
+
+blockquote = "adsfafewag"
+//blockquote = Blockquote:: "\"\"" (block | text "\"\"")