comparison src/urweb.lex @ 838:5154a047c6bc

Lexing some more string escape sequences; JS versions of number read; fix problem with signature unification; escape < more often in Jscomp
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 19:28:25 -0400
parents 395a5d450cc0
children d1b6acaec265
comparison
equal deleted inserted replaced
837:ccf22c2c77b2 838:5154a047c6bc
191 <COMMENT> "(*" => (enterComment (pos yypos); 191 <COMMENT> "(*" => (enterComment (pos yypos);
192 continue ()); 192 continue ());
193 <COMMENT> "*)" => (if exitComment () then YYBEGIN INITIAL else (); 193 <COMMENT> "*)" => (if exitComment () then YYBEGIN INITIAL else ();
194 continue ()); 194 continue ());
195 195
196 <STRING,CHAR> "\\\"" => (str := #"\"" :: !str; continue());
197 <STRING,CHAR> "\\'" => (str := #"'" :: !str; continue());
198 <STRING,CHAR> "\\n" => (str := #"\n" :: !str; continue());
199 <STRING,CHAR> "\\t" => (str := #"\t" :: !str; continue());
200 <STRING,CHAR> "\n" => (newline yypos;
201 str := #"\n" :: !str; continue());
202
196 <INITIAL> "#\"" => (YYBEGIN CHAR; strEnder := #"\""; strStart := pos yypos; str := []; continue()); 203 <INITIAL> "#\"" => (YYBEGIN CHAR; strEnder := #"\""; strStart := pos yypos; str := []; continue());
197 <CHAR> "\\\"" => (str := #"\"" :: !str; continue()); 204
198 <CHAR> "\\'" => (str := #"'" :: !str; continue());
199 <CHAR> "\n" => (newline yypos;
200 str := #"\n" :: !str; continue());
201 <CHAR> . => (let 205 <CHAR> . => (let
202 val ch = String.sub (yytext, 0) 206 val ch = String.sub (yytext, 0)
203 in 207 in
204 if ch = !strEnder then 208 if ch = !strEnder then
205 let 209 let
218 continue ()) 222 continue ())
219 end); 223 end);
220 224
221 <INITIAL> "\"" => (YYBEGIN STRING; strEnder := #"\""; strStart := pos yypos; str := []; continue()); 225 <INITIAL> "\"" => (YYBEGIN STRING; strEnder := #"\""; strStart := pos yypos; str := []; continue());
222 <INITIAL> "'" => (YYBEGIN STRING; strEnder := #"'"; strStart := pos yypos; str := []; continue()); 226 <INITIAL> "'" => (YYBEGIN STRING; strEnder := #"'"; strStart := pos yypos; str := []; continue());
223 <STRING> "\\\"" => (str := #"\"" :: !str; continue()); 227
224 <STRING> "\\'" => (str := #"'" :: !str; continue());
225 <STRING> "\n" => (newline yypos;
226 str := #"\n" :: !str; continue());
227 <STRING> . => (let 228 <STRING> . => (let
228 val ch = String.sub (yytext, 0) 229 val ch = String.sub (yytext, 0)
229 in 230 in
230 if ch = !strEnder then 231 if ch = !strEnder then
231 (if !xmlString then 232 (if !xmlString then