checkpoint
[sbp.git] / tests / tibdoc.g
index 1df3fb8..a2f5cac 100644 (file)
@@ -37,27 +37,30 @@ 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"
+
+onums     !::= nums (". "|") ")
+any       !::= ~[]*
+
+uli        ::= "* "         (ws text &~ any (oli|uli)) => "li"
+oli        ::= ("# "|onums) (ws text &~ any (oli|uli)) => "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 => []
+             > { uli+/ws => "ul" }       Itemx  => []
+             | { oli+/ws => "ol" }       Itemx  => []
+             > pre                       Itemx  => []
+             > structured                Itemx  => []
+             > structuredx               Itemx  => []
+             > styled                    Itemx  => []
+             > qtext                     Itemx  => []
+             > (alphanum++ => stringify) Itemx  => []
+             > symbol                    Itemx  => []
+             > (sym++ => stringify)      Itemx  => []
+             > Paragraph                 Itemx  => []
 
 blockquote ::= "\"\"" text "\"\""        => "blockquote"
              | "\"\"" block              => "blockquote"