diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2020-05-31 18:29:03 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2020-05-31 18:29:03 -0400 |
commit | 6cc104634ef64be3be88c1fccbe98208d95d8a1a (patch) | |
tree | 9001e5333e808808125978a52669a8bff3639438 /src/urweb.lex | |
parent | 82fde07cef0e41b700b9a30137562eb05f2f2c6d (diff) | |
parent | c2f1e1096f602b1cbd4531352f3e1ea6d656a186 (diff) |
Merge branch 'dfsg_clean'
Diffstat (limited to 'src/urweb.lex')
-rw-r--r-- | src/urweb.lex | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/urweb.lex b/src/urweb.lex index 368b9f1b..23c32ea1 100644 --- a/src/urweb.lex +++ b/src/urweb.lex @@ -174,7 +174,7 @@ fun unescape loc s = %% %header (functor UrwebLexFn(structure Tokens : Urweb_TOKENS)); %full -%s COMMENT STRING CHAR XML XMLTAG; +%s COMMENT XMLCOMMENT STRING CHAR XML XMLTAG; id = [a-z_][A-Za-z0-9_']*; xmlid = [A-Za-z][A-Za-z0-9_-]*; @@ -184,13 +184,12 @@ intconst = [0-9]+; realconst = [0-9]+\.[0-9]*; hexconst = 0x[0-9A-F]+; notags = ([^<{\n(]|(\([^\*<{\n]))+; -xcom = ([^\-]|(-[^\-]))+; oint = [0-9][0-9][0-9]; xint = x[0-9a-fA-F][0-9a-fA-F]; %% -<INITIAL,COMMENT,XMLTAG> +<INITIAL,COMMENT,XMLTAG,XMLCOMMENT> \n => (newline yypos; continue ()); <XML> \n => (newline yypos; @@ -219,7 +218,9 @@ xint = x[0-9a-fA-F][0-9a-fA-F]; <COMMENT> "*)" => (exitComment (); continue ()); -<XML> "<!--" {xcom} "-->" => (continue ()); +<XML> "<!--" => (YYBEGIN XMLCOMMENT; continue ()); +<XMLCOMMENT> "-->" => (YYBEGIN XML; continue ()); +<XMLCOMMENT> . => (continue ()); <STRING,CHAR> "\\\"" => (str := #"\"" :: !str; continue()); <STRING,CHAR> "\\'" => (str := #"'" :: !str; continue()); |