]> granicus.if.org Git - php/commitdiff
fix heredoc+nowdoc
authorNuno Lopes <nlopess@php.net>
Thu, 10 Apr 2008 19:19:04 +0000 (19:19 +0000)
committerNuno Lopes <nlopess@php.net>
Thu, 10 Apr 2008 19:19:04 +0000 (19:19 +0000)
#patch by Matt Wilmas

Zend/zend_compile.c
Zend/zend_language_scanner.c
Zend/zend_language_scanner.l
Zend/zend_language_scanner_defs.h

index 82fec6c303e0c49ee52486ab614f57c69521c19e..b6b07013f01ccdc22a3ae9bcfe0b36a1f1a6bcb5 100644 (file)
@@ -4680,8 +4680,6 @@ again:
                case T_END_NOWDOC:
                        efree(Z_STRVAL(zendlval->u.constant));
                        break;
-               case EOF:
-                       return EOF;
        }
 
        INIT_PZVAL(&zendlval->u.constant);
index 9807442a34facb3270b9f799b37a65189b3d48dd..c77bbf66937eb4416f6780d2b36d6ab556be055c 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5.dev on Wed Apr  9 22:52:47 2008 */
+/* Generated by re2c 0.13.5.dev on Thu Apr 10 20:01:41 2008 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -2519,9 +2519,9 @@ yy181:
                /* Go back before last label char, to match in ST_END_HEREDOC state */
                yyless(yyleng - 2);
 
-               /* Subtract the label/newline length. yyleng must include newline
+               /* Subtract the remaining label length. yyleng must include newline
                 * before label, for zend_highlight/strip, tokenizer, etc. */
-               yyleng -= CG(heredoc_len) + 1;
+               yyleng -= CG(heredoc_len) - 1;
 
                CG(increment_lineno) = 1; /* For newline before label */
                BEGIN(ST_END_HEREDOC);
@@ -8279,9 +8279,9 @@ yy932:
                /* Go back before last label char, to match in ST_END_NOWDOC state */
                yyless(yyleng - 2);
 
-               /* Subtract the label/newline length. yyleng must include newline
+               /* Subtract the remaining label length. yyleng must include newline
                 * before label, for zend_highlight/strip, tokenizer, etc. */
-               yyleng -= CG(heredoc_len) + 1;
+               yyleng -= CG(heredoc_len) - 1;
 
                CG(increment_lineno) = 1; /* For newline before label */
                BEGIN(ST_END_NOWDOC);
index 8802ffd1316eaa1f2d7523cda7e92dc3118bc0b3..16523f99e8b674f13fb16a7c41296c65a57dd239 100644 (file)
@@ -1733,9 +1733,9 @@ inline_char_handler:
                /* Go back before last label char, to match in ST_END_HEREDOC state */
                yyless(yyleng - 2);
 
-               /* Subtract the label/newline length. yyleng must include newline
+               /* Subtract the remaining label length. yyleng must include newline
                 * before label, for zend_highlight/strip, tokenizer, etc. */
-               yyleng -= CG(heredoc_len) + 1;
+               yyleng -= CG(heredoc_len) - 1;
 
                CG(increment_lineno) = 1; /* For newline before label */
                BEGIN(ST_END_HEREDOC);
@@ -1885,9 +1885,9 @@ inline_char_handler:
                /* Go back before last label char, to match in ST_END_NOWDOC state */
                yyless(yyleng - 2);
 
-               /* Subtract the label/newline length. yyleng must include newline
+               /* Subtract the remaining label length. yyleng must include newline
                 * before label, for zend_highlight/strip, tokenizer, etc. */
-               yyleng -= CG(heredoc_len) + 1;
+               yyleng -= CG(heredoc_len) - 1;
 
                CG(increment_lineno) = 1; /* For newline before label */
                BEGIN(ST_END_NOWDOC);
index 7624797e71e166a4b5d87816824b6d45bed3268f..146a2c6cf6976115d7f4657accfccdade36897b4 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5.dev on Wed Apr  9 22:52:47 2008 */
+/* Generated by re2c 0.13.5.dev on Thu Apr 10 20:01:41 2008 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {