comparison src/urweb.lex @ 1366:1595a738e4e9

JavaScript compilation of time comparison; fix lexing of XML that includes open parens
author Adam Chlipala <adam@chlipala.net>
date Fri, 24 Dec 2010 18:55:13 -0500
parents 3a845f2ce9e9
children 7d024767b024
comparison
equal deleted inserted replaced
1365:b02cb9da5686 1366:1595a738e4e9
170 id = [a-z_][A-Za-z0-9_']*; 170 id = [a-z_][A-Za-z0-9_']*;
171 cid = [A-Z][A-Za-z0-9_]*; 171 cid = [A-Z][A-Za-z0-9_]*;
172 ws = [\ \t\012]; 172 ws = [\ \t\012];
173 intconst = [0-9]+; 173 intconst = [0-9]+;
174 realconst = [0-9]+\.[0-9]*; 174 realconst = [0-9]+\.[0-9]*;
175 notags = ([^<{\n(]|(\([^\*]))+; 175 notags = ([^<{\n(]|(\([^\*<{\n]))+;
176 xcom = ([^\-]|(-[^\-]))+; 176 xcom = ([^\-]|(-[^\-]))+;
177 oint = [0-9][0-9][0-9]; 177 oint = [0-9][0-9][0-9];
178 xint = x[0-9a-fA-F][0-9a-fA-F]; 178 xint = x[0-9a-fA-F][0-9a-fA-F];
179 179
180 %% 180 %%
336 pushLevel (fn () => YYBEGIN XML); 336 pushLevel (fn () => YYBEGIN XML);
337 Tokens.LBRACE (yypos, yypos + 1)); 337 Tokens.LBRACE (yypos, yypos + 1));
338 338
339 <XML> {notags} => (Tokens.NOTAGS (unescape (yypos, yypos + size yytext) yytext, yypos, yypos + size yytext)); 339 <XML> {notags} => (Tokens.NOTAGS (unescape (yypos, yypos + size yytext) yytext, yypos, yypos + size yytext));
340 340
341 <XML> "(" => (Tokens.NOTAGS ("(", yypos, yypos + size yytext));
342
341 <XML> . => (ErrorMsg.errorAt' (yypos, yypos) 343 <XML> . => (ErrorMsg.errorAt' (yypos, yypos)
342 ("illegal XML character: \"" ^ yytext ^ "\""); 344 ("illegal XML character: \"" ^ yytext ^ "\"");
343 continue ()); 345 continue ());
344 346
345 <INITIAL> "()" => (Tokens.UNIT (pos yypos, pos yypos + size yytext)); 347 <INITIAL> "()" => (Tokens.UNIT (pos yypos, pos yypos + size yytext));