From 576949f00da484e776a75be16a45f5f39038ed21 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 10 Aug 2010 14:52:33 -0400 Subject: HTML comments --- src/urweb.lex | 3 +++ tests/xcomments.ur | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) 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]; "*)" => (exitComment (); continue ()); + "" => (continue ()); + "\\\"" => (str := #"\"" :: !str; continue()); "\\'" => (str := #"'" :: !str; continue()); "\\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 () = Hi! fun main () = return A (* B *) C (* D (* E *) F *) D
- A (* B *) C D (* E *) F {foo ()} + A (* B *) C D (* E *) F {foo ()} + A C D
+ A C D F {foo ()}
-- cgit v1.2.3