hexnum = 0x[0-9a-fA-F][0-9a-fA-F]*;
ws = [\ \t\012];
+quote = [\"];
%%
<COMMENT_LINE> \n => (ParseState.newline yypos; YYBEGIN INITIAL; lex());
<COMMENT_LINE> . => (lex());
-<STRING> [^\"\\]* => (addString yytext ; lex() );
+<STRING> "\\\\" => (addString "\\" ; lex() );
+<STRING> "\\n" => (addString "\n" ; lex() );
+<STRING> "\\r" => (addString "\r" ; lex() );
+<STRING> "\\t" => (addString "\t" ; lex() );
+<STRING> "\\\"" => (addString "\t" ; lex() );
+<STRING> "\\". => (ErrorMsg.error (ParseState.ext (yypos,yypos))
+ ("illegal escape sequence: \"" ^ yytext ^ "\"");
+ lex ());
+<STRING> "\n" => (ErrorMsg.error (ParseState.ext (yypos,yypos))
+ ("illegal newline in the middle of the string, asshole");
+ lex ());
<STRING> "\"" => (YYBEGIN INITIAL; endString yypos );
+<STRING> . => (addString yytext ; lex() );