X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Ftibdoc.g;fp=tests%2Ftibdoc.g;h=a1414d0248177a60a3a583c0554a4142f3ec8db2;hp=f93c5ddd1b8ffd0fee7758ed54883039de3b3537;hb=92d14ef4956f39a591363709ed95bfa2999dc319;hpb=c4b4207ce1be50359c6bd8abe1d657ff8ae8ad6e diff --git a/tests/tibdoc.g b/tests/tibdoc.g index f93c5dd..a1414d0 100644 --- a/tests/tibdoc.g +++ b/tests/tibdoc.g @@ -57,7 +57,7 @@ nw = ~[\r\n\ ] s = Doc Doc = head:Header ws! body:Body -Header = { "header" { KeyVal */ ws } /ws } +Header = { "\\header" { KeyVal */ ws } /ws } Body = { Section } */ws Section = SectionHeader ws! Paragraph* SectionHeader = "==" SectionHeaderBody "==" @@ -87,7 +87,7 @@ Item*/ws = blockquote > { UL:: uli+/ws } | { OL:: oli+/ws } - > pre + > Verbatim > link > structured > styled @@ -101,7 +101,7 @@ word = Chars:: bareword blockquote = "adsfafewag" //blockquote = Blockquote:: "\"\"" (block | text "\"\"") -pre = Verbatim:: "[verbatim]" { ~[]+ } /ws // FIXME doesn't work +Verbatim = "[verbatim]" ws! { (~[])++ } styled = Underline:: "__" text "__" | Footnote:: "((" text "))" @@ -117,18 +117,22 @@ styled = Underline:: "__" text "__" block = { text } -link = LinkText:: text:({ text }) "->" href:(url|email) - > LinkChars:: text:alphanum++ ws! "->" href:(url|email) +link = text:({ text }|word) "->" href:(url|email) structured = command & "\\" ([a-zA-Z0-9]++)! block? > glyph > email > url -glyph = Euro:: "(e)" | "(r)" | "(c)" | "(tm)" | emdash:: "--" | "..." +glyph = euro:: "(e)" + | r:: "(r)" + | c:: "(c)" + | tm:: "(tm)" + | emdash:: "--" + | ellipses:: "..." + | cent:: "\\cent" -command = Today:: "\\today" - | LineBreak:: "\\br" +command = "\\" [a-z]++ // URLs //////////////////////////////////////////////////////////////////////////////