Lexor handle escaped slash in strings.

This commit is contained in:
steve 2007-02-09 05:19:04 +00:00
parent 3fd80b09f0
commit 97234cb7ca
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: lexor.lex,v 1.93 2007/01/27 05:36:11 steve Exp $" #ident "$Id: lexor.lex,v 1.94 2007/02/09 05:19:04 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -163,7 +163,8 @@ W [ \t\b\f\r]+
[}{;:\[\],()#=.@&!?<>%|^~+*/-] { return yytext[0]; } [}{;:\[\],()#=.@&!?<>%|^~+*/-] { return yytext[0]; }
\" { BEGIN(CSTRING); } \" { BEGIN(CSTRING); }
<CSTRING>\\\" { yymore(); } <CSTRING>\\\\ { yymore(); /* Catch \\, which is a \ escaping itself */ }
<CSTRING>\\\" { yymore(); /* Catch \", which is an escaped quote */ }
<CSTRING>\n { BEGIN(0); <CSTRING>\n { BEGIN(0);
yylval.text = strdup(yytext); yylval.text = strdup(yytext);
VLerror(yylloc, "Missing close quote of string."); VLerror(yylloc, "Missing close quote of string.");