X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Ftibdoc.g;h=adc6e5e1c6d1da37718e6d176675ebed4ad21759;hp=38104af6e63207de89d49b8c275fc076bf046ee5;hb=08aa6cdd07a882fdedf7a6d5c7bd0d754460965b;hpb=9ded11559a1b6f817e99355b1c9e2c88042e91d4 diff --git a/tests/tibdoc.g b/tests/tibdoc.g index 38104af..adc6e5e 100644 --- a/tests/tibdoc.g +++ b/tests/tibdoc.g @@ -20,38 +20,41 @@ 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 -Section ::= SectionHeader Paragraph*/ws /ws => section +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 => "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" +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++ itemx => [] + > symbol itemx => [] // > sym++ itemx => [] - > Paragraph itemx => "7" + > Paragraph itemx => [] symbol ::= sym++ @@ -75,7 +78,7 @@ styled ::= "__" text "__" => ul > "*" text "*" => it block ::= { text } -structured ::= { text } "->" (url|email) => link +structured ::= { text } "->" (url|email) => link //> alphanum++ "->" (url|email) => link structuredx ::= glyph > email