comparison src/lacweb.lex @ 104:b1e5398a7f30

Initial HTML attributes support
author Adam Chlipala <adamc@hcoop.net>
date Thu, 10 Jul 2008 15:04:32 -0400
parents f0f59e918cac
children 813e5a52063d
comparison
equal deleted inserted replaced
103:8921f0344193 104:b1e5398a7f30
141 <COMMENT> "*)" => (if exitComment () then YYBEGIN INITIAL else (); 141 <COMMENT> "*)" => (if exitComment () then YYBEGIN INITIAL else ();
142 continue ()); 142 continue ());
143 143
144 <INITIAL> "\"" => (YYBEGIN STRING; strStart := pos yypos; str := []; continue()); 144 <INITIAL> "\"" => (YYBEGIN STRING; strStart := pos yypos; str := []; continue());
145 <STRING> "\\\"" => (str := #"\"" :: !str; continue()); 145 <STRING> "\\\"" => (str := #"\"" :: !str; continue());
146 <STRING> "\"" => (YYBEGIN INITIAL; 146 <STRING> "\"" => (if !xmlString then
147 (xmlString := false; YYBEGIN XMLTAG)
148 else
149 YYBEGIN INITIAL;
147 Tokens.STRING (String.implode (List.rev (!str)), !strStart, pos yypos + 1)); 150 Tokens.STRING (String.implode (List.rev (!str)), !strStart, pos yypos + 1));
148 <STRING> "\n" => (newline yypos; 151 <STRING> "\n" => (newline yypos;
149 str := #"\n" :: !str; continue()); 152 str := #"\n" :: !str; continue());
150 <STRING> . => (str := String.sub (yytext, 0) :: !str; continue()); 153 <STRING> . => (str := String.sub (yytext, 0) :: !str; continue());
151 154
194 | NONE => (ErrorMsg.errorAt' (yypos, yypos) 197 | NONE => (ErrorMsg.errorAt' (yypos, yypos)
195 ("Expected float, received: " ^ yytext); 198 ("Expected float, received: " ^ yytext);
196 continue ())); 199 continue ()));
197 <XMLTAG> "\"" => (YYBEGIN STRING; 200 <XMLTAG> "\"" => (YYBEGIN STRING;
198 xmlString := true; 201 xmlString := true;
199 strStart := yypos; str := []; continue()); 202 strStart := yypos; str := []; continue ());
200 203
201 <XMLTAG> "{" => (YYBEGIN INITIAL; 204 <XMLTAG> "{" => (YYBEGIN INITIAL;
202 pushLevel (fn () => YYBEGIN XMLTAG); 205 pushLevel (fn () => YYBEGIN XMLTAG);
203 Tokens.LBRACE (yypos, yypos + 1)); 206 Tokens.LBRACE (yypos, yypos + 1));
204 <XMLTAG> "(" => (YYBEGIN INITIAL; 207 <XMLTAG> "(" => (YYBEGIN INITIAL;