X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/2ab9671fde5297fc59583361f152e812e66c2d17..a644da892dbd55a7be1aed029dafebe28d26d27e:/parse/l5.lex?ds=inline diff --git a/parse/l5.lex b/parse/l5.lex index 3028a6c..667638c 100644 --- a/parse/l5.lex +++ b/parse/l5.lex @@ -85,6 +85,7 @@ decnum = [0-9][0-9]*; hexnum = 0x[0-9a-fA-F][0-9a-fA-F]*; ws = [\ \t\012]; +quote = [\"]; %% @@ -188,5 +189,16 @@ ws = [\ \t\012]; \n => (ParseState.newline yypos; YYBEGIN INITIAL; lex()); . => (lex()); - [^\"\\]* => (addString yytext ; lex() ); + "\\\\" => (addString "\\" ; lex() ); + "\\n" => (addString "\n" ; lex() ); + "\\r" => (addString "\r" ; lex() ); + "\\t" => (addString "\t" ; lex() ); + "\\\"" => (addString "\t" ; lex() ); + "\\". => (ErrorMsg.error (ParseState.ext (yypos,yypos)) + ("illegal escape sequence: \"" ^ yytext ^ "\""); + lex ()); + "\n" => (ErrorMsg.error (ParseState.ext (yypos,yypos)) + ("illegal newline in the middle of the string, asshole"); + lex ()); "\"" => (YYBEGIN INITIAL; endString yypos ); + . => (addString yytext ; lex() );