got new tib tokenizer going
[sbp.git] / tests / tibdoc.g
index 2d026e8..adc6e5e 100644 (file)
@@ -20,25 +20,28 @@ nw       ::= ~[\r\n\ ]
 
 //////////////////////////////////////////////////////////////////////////////
 
 
 //////////////////////////////////////////////////////////////////////////////
 
-s                 ::= {Doc} => top
+s                 ::= Doc => top
 
 
-Doc               ::= Header Body                         /ws => doc
-Header            ::= "header" { kv */ ws }               /ws => header
+Doc               ::= {Header} Body                   /ws => doc
+Header            ::= "header" { kv */ ws }           /ws => header
 Body              ::= Section*/ws                             => body
 Body              ::= Section*/ws                             => body
-Section           ::= SectionHeader Paragraph*/ws         /ws => section
+Section           ::= { SectionHeader Paragraph* /ws => section }
 SectionHeader     ::= "==" SectionHeaderBody "=="
 SectionHeaderBody ::=  "=" SectionHeaderBody "="
                     >      ws text ws
 
 SectionHeader     ::= "==" SectionHeaderBody "=="
 SectionHeaderBody ::=  "=" SectionHeaderBody "="
                     >      ws text ws
 
+sp    !::= " "**
+blank  ::= sp "\n" sp "\n" ws
+
 kv         ::= word "=" text /ws => kv1
 
 num !::= [0-9]++
 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"
+Paragraph  ::= { "\"\"" ws text  }  => "blockquote"
+             > { "*" " " ws text }  => "ul"
+             > { "#" " " ws text }  => "ol"
+             > { num " " ws text }  => "ol"
+             > { "---" "-"*      }  => "hr"
+             > { text }             => "p"
 
 text       ::= item
 itemx      ::= ws item | ()
 
 text       ::= item
 itemx      ::= ws item | ()