fix emdash/endash confusion
[wix.git] / src / wix.g
index 8289970..348ce40 100644 (file)
--- a/src/wix.g
+++ b/src/wix.g
@@ -15,7 +15,7 @@ Body::              = Section */ br
 Section::           = SectionHeader
                     | SectionHeader (nl|br) >> Pars <<
                     > SectionHeader (nl|br) Pars
 Section::           = SectionHeader
                     | SectionHeader (nl|br) >> Pars <<
                     > SectionHeader (nl|br) Pars
-SectionHeader::     = (^"=" [=]++) ws (Text &~ ... "\n" ...)
+SectionHeader::     = (^"=" [=]++) ws (Text & ~[\n]*)
 
 Pars::              = (Par <<* & indent.Balanced &~ "=" ...) */ br
 
 
 Pars::              = (Par <<* & indent.Balanced &~ "=" ...) */ br
 
@@ -58,9 +58,9 @@ Text::              = `Text     nl            >> (Pars:: NonTextParagraph)
                     > `TextWS   Atom
                     | `TextWS   (Command::    "\\" ("":: [a-zA-Z0-9:]++ &~ "pre") Block)
                     | `TextWS   (Command::    "\\" ("":: [a-zA-Z0-9:]++ &~ "pre") -> ~"{")     
                     > `TextWS   Atom
                     | `TextWS   (Command::    "\\" ("":: [a-zA-Z0-9:]++ &~ "pre") Block)
                     | `TextWS   (Command::    "\\" ("":: [a-zA-Z0-9:]++ &~ "pre") -> ~"{")     
-                    | `TextWS   (Quotes::  "\"" (Text &~ ... "\"" ...) "\"")
+                    | `TextWS   (Quotes::  "\"" (Text & ~[\"]*) "\"")
                     | `TextWS   glyph                                                 
                     | `TextWS   glyph                                                 
-                    > `TextWS   (Word:: sym)
+                    > `TextWS   sym
                     > `Text     (WS:: br)     >> (Pars -> <<)   // subparagraph
 
 href                =        url.Email
                     > `Text     (WS:: br)     >> (Pars -> <<)   // subparagraph
 
 href                =        url.Email
@@ -82,25 +82,28 @@ Ordinal::           = `("":: [0-9]*) ( [1]    "st"
 
 styled              = Underline::     "__"       Text                       "__"      
                     | Footnote::      "(("       Text                       "))"
 
 styled              = Underline::     "__"       Text                       "__"      
                     | Footnote::      "(("       Text                       "))"
-                    | TT::            "[["  ws  (Text &~ ... "]]" ...)  ws  "]]"
+                    | TT::            "[["  ws  (Text & ((~[\]]! | "]" -> ~[\]])*))  ws  "]]"
                     | Strikethrough:: "!!"       Text         "!!"      
                     | Superscript::   "^^"       Atom
                     | Subscript::     ",,"       Atom
                     | Strikethrough:: "!!"       Text         "!!"      
                     | Superscript::   "^^"       Atom
                     | Subscript::     ",,"       Atom
-                    | Bold::          "++"      (Text &~ ... "++" ...)      "++"
-                    | Highlight::     "##"      (Text &~ ... "##" ...)      "##"
-                    | Math::          "$$"      (~[$] | ([$] -> ~[$]))+     "$$"
+                    | Bold::          "++"      (Text & ((~[\+]! | "+" -> ~[\+])*))      "++"
+                    | Highlight::     "##"      (Text & ((~[\#]! | "#" -> ~[\#])*))      "##"
+                    | Math::          "$$"      (~[\$] | ([\$] -> ~[\$]))+     "$$"
                     | Keyword::       "!"        Atom
                     | Keyword::       "!"        Atom
-                    | Italic::        "**"      (Text &~ ... "**" ...)      "**"
+                    | Italic::        "**"      (Text & ((~[\*]! | "*" -> ~[\*])*))      "**"
 
 
-glyph               = ^"(e)" | ^"(r)" | ^"(c)" | ^"(tm)" | ^"--"
+glyph               = ^"(e)" | ^"(r)" | ^"(c)" | ^"(tm)" | ^"--" | ^"---"
                     | ^"..." | ^"<-" | ^"<=" | ^"=>" | ^"<->"
                     | ^"<=>" | ^"<-" | ^"^o"
                     // ^"->"
 
                     | ^"..." | ^"<-" | ^"<=" | ^"=>" | ^"<->"
                     | ^"<=>" | ^"<-" | ^"^o"
                     // ^"->"
 
+
+
+
 // Chars ///////////////////////////////////////////////////////////////
 
 // Chars ///////////////////////////////////////////////////////////////
 
-sym         = "\\" ~tok.alphanum
-            | ~(tok.alphanum | [\r\n \\{}>><<])
+sym         = Word:: "\\" ~tok.alphanum
+            | Word:: ~(tok.alphanum | [\r\n \\{}>><<])
 
 hws!        = [ \r>>]
 ws!         = (hws* "\n")? hws*                   -> ~[ \n\r]
 
 hws!        = [ \r>>]
 ws!         = (hws* "\n")? hws*                   -> ~[ \n\r]