cvs: ZendEngine2(PHP_5_2) / zend_language_scanner.l
| From: | Dmitry Stogov | Date: | Thu, 24 May 2007 08:56:35 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_language_scanner.l | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5815@lists.php.net to get a copy of this message | ||
dmitry Thu May 24 08:56:35 2007 UTC
Modified files: (Branch: PHP_5_2)
/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.131.2.11.2.11&r2=1.131.2.11.2.12&diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.131.2.11.2.11
ZendEngine2/zend_language_scanner.l:1.131.2.11.2.12
--- ZendEngine2/zend_language_scanner.l:1.131.2.11.2.11 Fri May 18 13:12:04 2007
+++ ZendEngine2/zend_language_scanner.l Thu May 24 08:56:35 2007
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_language_scanner.l,v 1.131.2.11.2.11 2007/05/18 13:12:04 dmitry Exp $ */
+/* $Id: zend_language_scanner.l,v 1.131.2.11.2.12 2007/05/24 08:56:35 dmitry Exp $ */
#define yyleng SCNG(yy_leng)
#define yytext SCNG(yy_text)
@@ -1648,14 +1648,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_STRING(zendlval); /* Empty since it won't be used */
+ return T_ENCAPSED_AND_WHITESPACE;
}
<ST_IN_SCRIPTING,ST_VAR_OFFSET>{LABEL} {
@@ -1935,8 +1938,8 @@
zend_scan_escape_string(zendlval, yytext, len, 0 TSRMLS_CC);
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();
}