diff options
-rw-r--r-- | src/urweb.lex | 3 | ||||
-rw-r--r-- | tests/xcomments.ur | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/urweb.lex b/src/urweb.lex index 8a989884..88b7d857 100644 --- a/src/urweb.lex +++ b/src/urweb.lex @@ -173,6 +173,7 @@ ws = [\ \t\012]; intconst = [0-9]+; realconst = [0-9]+\.[0-9]*; notags = [^<{\n(]+; +xcom = ([^-]|(-[^-]))+; oint = [0-9][0-9][0-9]; xint = x[0-9a-fA-F][0-9a-fA-F]; @@ -207,6 +208,8 @@ xint = x[0-9a-fA-F][0-9a-fA-F]; <COMMENT> "*)" => (exitComment (); continue ()); +<XML> "<!--" {xcom} "-->" => (continue ()); + <STRING,CHAR> "\\\"" => (str := #"\"" :: !str; continue()); <STRING,CHAR> "\\'" => (str := #"'" :: !str; continue()); <STRING,CHAR> "\\n" => (str := #"\n" :: !str; continue()); diff --git a/tests/xcomments.ur b/tests/xcomments.ur index 61a0b34b..83608ff9 100644 --- a/tests/xcomments.ur +++ b/tests/xcomments.ur @@ -4,5 +4,7 @@ fun foo () = <xml>Hi!</xml> fun main () = return <xml><body> A (* B *) C (* D (* E *) F *) D<br/> - <b>A</b> <i>(* B *) C <b>D (* E *) F {foo ()}</b></i> + <b>A</b> <i>(* B *) C <b>D (* E <!-- 7 --> *) F {foo ()}</b></i> + A <!-- B --> C <!-- D (* E *) F --> D<br/> + <b>A</b> <i><!-- B --> C <b>D <!-- E --> F {foo ()}</b></i> </body></xml> |