cvs: ZendEngine2 / zend_language_scanner.l
| From: | Dmitry Stogov | Date: | Thu, 24 May 2007 08:56:50 +0000 |
| Subject: | cvs: ZendEngine2 / zend_language_scanner.l | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5816@lists.php.net to get a copy of this message | ||
dmitry Thu May 24 08:56:50 2007 UTC
Modified files:
/ZendEngine2 zend_language_scanner.l
Log:
Impoved error reporting on parser errors (Matt, Dmitry)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.165&r2=1.166&diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.165 ZendEngine2/zend_language_scanner.l:1.166
--- ZendEngine2/zend_language_scanner.l:1.165 Fri May 18 13:12:47 2007
+++ ZendEngine2/zend_language_scanner.l Thu May 24 08:56:50 2007
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_language_scanner.l,v 1.165 2007/05/18 13:12:47 dmitry Exp $ */
+/* $Id: zend_language_scanner.l,v 1.166 2007/05/24 08:56:50 dmitry Exp $ */
#define yyleng SCNG(yy_leng)
#define yytext SCNG(yy_text)
@@ -2186,14 +2186,17 @@
return ']';
}
-<ST_VAR_OFFSET>{TOKENS}|[{}] {
+<ST_VAR_OFFSET>{TOKENS}|[{}"`] {
/* Only '[' can be valid, but returning other tokens will allow a more explicit parse
error */
return yytext[0];
}
-<ST_VAR_OFFSET>[ \n\r\t'"`\\#] {
+<ST_VAR_OFFSET>[ \n\r\t\\'#] {
+ /* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
yy_pop_state(TSRMLS_C);
+ ZVAL_EMPTY_TEXT(zendlval); /* Empty since it won't be used */
+ return T_ENCAPSED_AND_WHITESPACE;
}
<ST_IN_SCRIPTING>{LABEL} {
@@ -2483,8 +2486,8 @@
return T_ENCAPSED_AND_WHITESPACE;
}
} else {
- /* Go back to end of label, so there's something to match again in case
- * there's a variable at the beginning of the next line */
+ /* Go back to end of label, so the next match works correctly in case of
+ * a variable or another label at the beginning of the next line */
yyless(yyleng - 1);
yymore();
}