scottmac                Wed Mar 26 14:46:17 2008 UTC

  Modified files:              
    /php-src    Makefile.frag acinclude.m4 configure.in 
    /php-src/ext/spl    php_spl.c 
    /php-src/ext/standard/tests/strings 006.phpt 007.phpt 
                                        highlight_file.phpt 
                                        strip_tags_basic1.phpt 
                                        strip_tags_basic2.phpt 
                                        strip_tags_error.phpt 
                                        strip_tags_variation1.phpt 
                                        strip_tags_variation10.phpt 
                                        strip_tags_variation2.phpt 
                                        strip_tags_variation3.phpt 
                                        strip_tags_variation4.phpt 
                                        strip_tags_variation6.phpt 
                                        strip_tags_variation7.phpt 
                                        strip_tags_variation8.phpt 
    /php-src/ext/tokenizer      Makefile.frag tokenizer.c 
    /php-src/ext/tokenizer/tests        token_get_all_variation14.phpt 
    /php-src/main       main.c 
    /php-src/sapi/cgi   cgi_main.c 
    /php-src/sapi/cli   php_cli.c 
    /php-src/win32/build        Makefile config.w32 
  Log:
  MFB 5.3: Rest of the changes for re2c merge
  
  
  
http://cvs.php.net/viewvc.cgi/php-src/Makefile.frag?r1=1.5&r2=1.6&diff_format=u
Index: php-src/Makefile.frag
diff -u php-src/Makefile.frag:1.5 php-src/Makefile.frag:1.6
--- php-src/Makefile.frag:1.5   Thu May 24 21:43:56 2007
+++ php-src/Makefile.frag       Wed Mar 26 14:46:16 2008
@@ -7,7 +7,7 @@
 $(builddir)/zend_ini_scanner.lo: $(srcdir)/zend_ini_parser.h
 
 $(srcdir)/zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
-       @$(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i 
$(srcdir)/zend_language_scanner.l
+       @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c 
Zend/zend_language_scanner.l)
 
 $(srcdir)/zend_language_parser.h: $(srcdir)/zend_language_parser.c
 $(srcdir)/zend_language_parser.c: $(srcdir)/zend_language_parser.y
@@ -18,6 +18,6 @@
        @$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o $@
 
 $(srcdir)/zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
-       @$(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l
+       @(cd $(top_srcdir); $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l)
 
 $(builddir)/zend_indent.lo $(builddir)/zend_highlight.lo 
$(builddir)/zend_compile.lo: $(srcdir)/zend_language_parser.h
http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.386&r2=1.387&diff_format=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.386 php-src/acinclude.m4:1.387
--- php-src/acinclude.m4:1.386  Sun Feb 17 20:49:45 2008
+++ php-src/acinclude.m4        Wed Mar 26 14:46:16 2008
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.386 2008/02/17 20:49:45 helly Exp $
+dnl $Id: acinclude.m4,v 1.387 2008/03/26 14:46:16 scottmac Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -2155,7 +2155,7 @@
   if test -n "$RE2C"; then
     AC_CACHE_CHECK([for re2c version], php_cv_re2c_version, [
       re2c_vernum=`re2c --vernum 2>/dev/null`
-      if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1200"; then
+      if test -z "$re2c_vernum" || test "$re2c_vernum" -lt "1304"; then
         php_cv_re2c_version=invalid
       else
         php_cv_re2c_version="`re2c --version | cut -d ' ' -f 2  2>/dev/null` 
(ok)"
@@ -2164,7 +2164,7 @@
   fi
   case $php_cv_re2c_version in
     ""|invalid[)]
-      AC_MSG_WARN([You will need re2c 0.12.0 or later if you want to 
regenerate PHP parsers.])
+      AC_MSG_WARN([You will need re2c 0.13.4 or later if you want to 
regenerate PHP parsers.])
       RE2C="exit 0;"
       ;;
   esac
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.649&r2=1.650&diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.649 php-src/configure.in:1.650
--- php-src/configure.in:1.649  Mon Mar 10 15:17:47 2008
+++ php-src/configure.in        Wed Mar 26 14:46:16 2008
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.649 2008/03/10 15:17:47 gwynne Exp $ -*- autoconf -*-
+## $Id: configure.in,v 1.650 2008/03/26 14:46:16 scottmac Exp $ -*- autoconf 
-*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -161,10 +161,38 @@
 PHP_RUNPATH_SWITCH
 
 dnl Checks for some support/generator progs
-PHP_PROG_RE2C
+
 PHP_PROG_AWK
 PHP_PROG_BISON
-PHP_PROG_LEX
+PHP_PROG_RE2C
+
+PHP_ARG_ENABLE(re2c-cgoto, whether to enable computed goto gcc extension with 
re2c,
+[  --enable-re2c-cgoto     Enable -g flag to re2c to use computed goto gcc 
extension], no, no)
+
+if test "$PHP_RE2C_CGOTO" = "no"; then
+  RE2C_FLAGS=""
+else
+  AC_MSG_CHECKING([whether re2c -g works])
+  AC_TRY_COMPILE([],[
+               int main(int argc, const char **argv)
+               {
+                       argc = argc;
+                       argv = argv;
+label1:
+label2:
+                       static void *adr[] = { &&label1, &&label2};
+                       goto *adr[0];
+                       return 0;
+               }
+  ],[
+    RE2C_FLAGS=""
+    AC_MSG_RESULT([no])
+  ],[
+    RE2C_FLAGS="-g"
+    AC_MSG_RESULT([yes])
+  ])
+fi
+PHP_SUBST(RE2C_FLAGS)
 
 dnl Platform-specific compile settings.
 dnl -------------------------------------------------------------------------
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.127&r2=1.128&diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.127 php-src/ext/spl/php_spl.c:1.128
--- php-src/ext/spl/php_spl.c:1.127     Fri Feb 29 13:48:09 2008
+++ php-src/ext/spl/php_spl.c   Wed Mar 26 14:46:16 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_spl.c,v 1.127 2008/02/29 13:48:09 colder Exp $ */
+/* $Id: php_spl.c,v 1.128 2008/03/26 14:46:16 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -233,7 +233,7 @@
                        zend_destroy_file_handle(&file_handle TSRMLS_CC);
                } else {
                        new_op_array = NULL;
-                       zend_file_handle_dtor(&file_handle);
+                       zend_file_handle_dtor(&file_handle TSRMLS_CC);
                }
                if (new_op_array) {
                        EG(return_value_ptr_ptr) = &result;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/006.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/006.phpt
diff -u php-src/ext/standard/tests/strings/006.phpt:1.1 
php-src/ext/standard/tests/strings/006.phpt:1.2
--- php-src/ext/standard/tests/strings/006.phpt:1.1     Thu May 10 16:27:16 2007
+++ php-src/ext/standard/tests/strings/006.phpt Wed Mar 26 14:46:17 2008
@@ -1,5 +1,7 @@
 --TEST--
 highlight_file() and output buffer
+--INI--
+log_errors_max_len=4096
 --FILE--
 <?php
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/007.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/007.phpt
diff -u php-src/ext/standard/tests/strings/007.phpt:1.1 
php-src/ext/standard/tests/strings/007.phpt:1.2
--- php-src/ext/standard/tests/strings/007.phpt:1.1     Thu May 10 16:27:16 2007
+++ php-src/ext/standard/tests/strings/007.phpt Wed Mar 26 14:46:17 2008
@@ -1,5 +1,7 @@
 --TEST--
 php_strip_whitespace() and output buffer
+--INI--
+log_errors_max_len=4096
 --FILE--
 <?php
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/highlight_file.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/strings/highlight_file.phpt
diff -u php-src/ext/standard/tests/strings/highlight_file.phpt:1.2 
php-src/ext/standard/tests/strings/highlight_file.phpt:1.3
--- php-src/ext/standard/tests/strings/highlight_file.phpt:1.2  Thu Apr 26 
09:39:03 2007
+++ php-src/ext/standard/tests/strings/highlight_file.phpt      Wed Mar 26 
14:46:17 2008
@@ -6,6 +6,7 @@
 highlight.keyword=#007700
 highlight.default=#0000BB
 highlight.html=#000000
+allow_url_include=1
 --FILE--
 <?php
 
@@ -14,19 +15,9 @@
 var_dump(highlight_file());
 var_dump(highlight_file($filename));
 
-$data = <<<DATA
-<?php echo "test"; ?>
-DATA;
+var_dump(highlight_file('data:,<?php echo "test"; ?>'));
 
-file_put_contents($filename, $data);
-var_dump(highlight_file($filename));
-
-$data = <<<DATA
-<?php echo "test ?>
-DATA;
-
-file_put_contents($filename, $data);
-var_dump(highlight_file($filename));
+var_dump(highlight_file('data:,<?php echo "test ?>'));
 
 $data = '
 <?php 
@@ -57,7 +48,7 @@
 </span>
 </code>bool(true)
 <code><span style="color: #000000">
-<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: 
#007700">echo&nbsp;</span><span style="color: #DD0000">"test&nbsp;?&gt;</span>
+<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: 
#007700">echo&nbsp;</span><span style="color: #FF9900">"test&nbsp;?&gt;</span>
 </span>
 </code>bool(true)
 <code><span style="color: #000000">
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_basic1.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_basic1.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_basic1.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_basic1.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_basic1.phpt:1.1       Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_basic1.phpt   Wed Mar 26 
14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : basic functionality - with default arguments
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_basic2.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_basic2.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_basic2.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_basic2.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_basic2.phpt:1.1       Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_basic2.phpt   Wed Mar 26 
14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : basic functionality - with all arguments
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_error.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_error.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_error.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_error.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_error.phpt:1.1        Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_error.phpt    Wed Mar 26 
14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : error conditions
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation1.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation1.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation1.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation1.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation1.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation1.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - unexpected values for 'str' 
argument
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation10.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation10.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation10.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation10.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation10.phpt:1.1  Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation10.phpt      Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - single quoted strings
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation2.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation2.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation2.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation2.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation2.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation2.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - unexpected values for 
'allowable_tags'
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation3.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation3.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation3.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation3.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation3.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation3.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - unexpected values for both 
'str' and 'allowable_tags'
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation4.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation4.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation4.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation4.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation4.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation4.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - invalid values for 'str' and 
valid 'allowable_tags'
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation6.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation6.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation6.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation6.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation6.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation6.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - binary safe checking
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation7.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation7.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation7.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation7.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation7.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation7.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - invalid values for 'str' and 
'allowable_tags'
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/strip_tags_variation8.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/strings/strip_tags_variation8.phpt
diff -u php-src/ext/standard/tests/strings/strip_tags_variation8.phpt:1.1 
php-src/ext/standard/tests/strings/strip_tags_variation8.phpt:1.2
--- php-src/ext/standard/tests/strings/strip_tags_variation8.phpt:1.1   Tue Oct 
 9 12:42:47 2007
+++ php-src/ext/standard/tests/strings/strip_tags_variation8.phpt       Wed Mar 
26 14:46:17 2008
@@ -1,7 +1,7 @@
 --TEST--
 Test strip_tags() function : usage variations - valid value for 'str' and 
invalid values for 'allowable_tags'
 --INI--
-set short_open_tag = on
+short_open_tag = on
 --FILE--
 <?php
 /* Prototype  : string strip_tags(string $str [, string $allowable_tags])
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/Makefile.frag?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/tokenizer/Makefile.frag
diff -u php-src/ext/tokenizer/Makefile.frag:1.4 
php-src/ext/tokenizer/Makefile.frag:1.5
--- php-src/ext/tokenizer/Makefile.frag:1.4     Thu May 24 21:43:56 2007
+++ php-src/ext/tokenizer/Makefile.frag Wed Mar 26 14:46:17 2008
@@ -1,2 +1,2 @@
-$(top_srcdir)/Zend/zend_language_parser.h:
-$(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.h
+
+$(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c 
$(top_srcdir)/Zend/zend_language_scanner.c
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.46&r2=1.47&diff_format=u
Index: php-src/ext/tokenizer/tokenizer.c
diff -u php-src/ext/tokenizer/tokenizer.c:1.46 
php-src/ext/tokenizer/tokenizer.c:1.47
--- php-src/ext/tokenizer/tokenizer.c:1.46      Tue Feb 12 09:28:30 2008
+++ php-src/ext/tokenizer/tokenizer.c   Wed Mar 26 14:46:17 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: tokenizer.c,v 1.46 2008/02/12 09:28:30 dmitry Exp $ */
+/* $Id: tokenizer.c,v 1.47 2008/03/26 14:46:17 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -27,67 +27,9 @@
 #include "ext/standard/info.h"
 #include "php_tokenizer.h"
 
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-typedef unsigned int yy_size_t;
-struct yy_buffer_state
-       {
-       FILE *yy_input_file;
- 
-       char *yy_ch_buf;   /* input buffer */
-       char *yy_buf_pos;  /* current position in input buffer */
- 
-       /* Size of input buffer in bytes, not including room for EOB
-        * characters.
-        */
-       yy_size_t yy_buf_size;
- 
-       /* Number of characters read into yy_ch_buf, not including EOB
-        * characters.
-        */
-       int yy_n_chars;
- 
-       /* Whether we "own" the buffer - i.e., we know we created it,
-        * and can realloc() it to grow it, and should free() it to
-        * delete it.
-        */
-       int yy_is_our_buffer;
- 
-       /* Whether this is an "interactive" input source; if so, and
-        * if we're using stdio for input, then we want to use getc()
-        * instead of fread(), to make sure we stop fetching input after
-        * each newline.
-        */
-       int yy_is_interactive;
- 
-       /* Whether we're considered to be at the beginning of a line.
-        * If so, '^' rules will be active on the next match, otherwise
-        * not.
-        */
-       int yy_at_bol;
- 
-       /* Whether to try to fill the input buffer when we reach the
-        * end of it.
-        */
-       int yy_fill_buffer;
- 
-       int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-       /* When an EOF's been seen but there's still some text to process
-        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-        * shouldn't try reading from the input source any more.  We might
-        * still have a bunch of tokens to match, though, because of
-        * possible backing-up.
-        *
-        * When we actually see the EOF, we change the status to "new"
-        * (via yyrestart()), so that the user can continue scanning by
-        * just pointing yyin at a new input file.
-        */
-#define YY_BUFFER_EOF_PENDING 2
-       };
-
 #include "zend.h"
 #include "zend_language_scanner.h"
+#include "zend_language_scanner_defs.h"
 #include <zend_language_parser.h>
 
 #define zendtext LANG_SCNG(yy_text)
@@ -224,7 +166,7 @@
                RETURN_EMPTY_STRING();
        }
 
-       LANG_SCNG(start) = 1;
+       LANG_SCNG(yy_state) = yycINITIAL;
 
        tokenize(return_value TSRMLS_CC);
        
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tests/token_get_all_variation14.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/tokenizer/tests/token_get_all_variation14.phpt
diff -u php-src/ext/tokenizer/tests/token_get_all_variation14.phpt:1.1 
php-src/ext/tokenizer/tests/token_get_all_variation14.phpt:1.2
--- php-src/ext/tokenizer/tests/token_get_all_variation14.phpt:1.1      Fri Dec 
14 16:19:29 2007
+++ php-src/ext/tokenizer/tests/token_get_all_variation14.phpt  Wed Mar 26 
14:46:17 2008
@@ -516,22 +516,13 @@
   }
 }
 -- with invalid PHP tags and tokens --
-array(2) {
+array(1) {
   [0]=>
   array(3) {
     [0]=>
     int(313)
     [1]=>
-    string(18) "<PDP display  $a; "
-    [2]=>
-    int(1)
-  }
-  [1]=>
-  array(3) {
-    [0]=>
-    int(313)
-    [1]=>
-    string(1) "<"
+    string(19) "<PDP display  $a; <"
     [2]=>
     int(1)
   }
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.769&r2=1.770&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.769 php-src/main/main.c:1.770
--- php-src/main/main.c:1.769   Sat Mar 22 12:56:07 2008
+++ php-src/main/main.c Wed Mar 26 14:46:17 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.769 2008/03/22 12:56:07 tony2001 Exp $ */
+/* $Id: main.c,v 1.770 2008/03/26 14:46:17 scottmac Exp $ */
 
 /* {{{ includes
  */
@@ -1159,15 +1159,26 @@
 }
 /* }}} */
 
-static void stream_closer_for_zend(void *handle TSRMLS_DC) /* {{{ */
+static void php_zend_stream_closer(void *handle TSRMLS_DC) /* {{{ */
 {
        php_stream_close((php_stream*)handle);
 }
 /* }}} */
 
-static long stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */
+static void php_zend_stream_mmap_closer(void *handle TSRMLS_DC) /* {{{ */
 {
-       return (long)php_stream_tell((php_stream*)handle);
+       php_stream_mmap_unmap((php_stream*)handle);
+       php_zend_stream_closer(handle TSRMLS_CC);
+}
+/* }}} */
+
+static size_t php_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */
+{
+       php_stream_statbuf  ssb;
+       if (php_stream_stat((php_stream*)handle, &ssb) == 0) {
+               return ssb.sb.st_size;
+       }
+       return 0;
 }
 /* }}} */
 
@@ -1179,19 +1190,30 @@
 
 PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle 
*handle, int mode TSRMLS_DC) /* {{{ */
 {
-       php_stream *stream;
-
-       stream = php_stream_open_wrapper((char *)filename, "rb", mode, 
&handle->opened_path);
+       char *p;
+       size_t len, mapped_len;
+       php_stream *stream = php_stream_open_wrapper((char *)filename, "rb", 
mode, &handle->opened_path);
 
        if (stream) {
-               handle->type = ZEND_HANDLE_STREAM;
                handle->filename = (char*)filename;
                handle->free_filename = 0;
-               handle->handle.stream.handle = stream;
-               handle->handle.stream.reader = 
(zend_stream_reader_t)_php_stream_read;
-               handle->handle.stream.closer = stream_closer_for_zend;
-               handle->handle.stream.fteller = stream_fteller_for_zend;
-               handle->handle.stream.interactive = 0;
+               handle->handle.stream.handle  = stream;
+               handle->handle.stream.reader  = 
(zend_stream_reader_t)_php_stream_read;
+               handle->handle.stream.fsizer  = php_zend_stream_fsizer;
+               handle->handle.stream.isatty  = 0;
+               /* can we mmap immeadiately? */
+               memset(&handle->handle.stream.mmap, 0, 
sizeof(handle->handle.stream.mmap));
+               len = php_zend_stream_fsizer(stream TSRMLS_CC) + 
ZEND_MMAP_AHEAD;
+               if (php_stream_mmap_possible(stream)
+               && (p = php_stream_mmap_range(stream, 0, len, 
PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped_len)) != NULL) {
+                       handle->handle.stream.closer   = 
php_zend_stream_mmap_closer;
+                       handle->handle.stream.mmap.buf = p;
+                       handle->handle.stream.mmap.len = mapped_len;
+                       handle->type = ZEND_HANDLE_MAPPED;
+               } else {
+                       handle->handle.stream.closer = php_zend_stream_closer;
+                       handle->type = ZEND_HANDLE_STREAM;
+               }
                /* suppress warning if this stream is not explicitly closed */
                php_stream_auto_cleanup(stream);
 
@@ -2126,7 +2148,7 @@
 
        EG(exit_status) = 0;
        if (php_handle_special_queries(TSRMLS_C)) {
-               zend_file_handle_dtor(primary_file);
+               zend_file_handle_dtor(primary_file TSRMLS_CC);
                return 0;
        }
 #ifndef HAVE_BROKEN_GETCWD
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.352&r2=1.353&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.352 php-src/sapi/cgi/cgi_main.c:1.353
--- php-src/sapi/cgi/cgi_main.c:1.352   Wed Mar 19 16:37:49 2008
+++ php-src/sapi/cgi/cgi_main.c Wed Mar 26 14:46:17 2008
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.352 2008/03/19 16:37:49 rasmus Exp $ */
+/* $Id: cgi_main.c,v 1.353 2008/03/26 14:46:17 scottmac Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1966,7 +1966,7 @@
                                case PHP_MODE_STRIP:
                                        if (open_file_for_scanning(&file_handle 
TSRMLS_CC) == SUCCESS) {
                                                zend_strip(TSRMLS_C);
-                                               fclose(file_handle.handle.fp);
+                                               
zend_file_handle_dtor(&file_handle TSRMLS_CC);
                                                php_output_teardown();
                                        }
                                        return SUCCESS;
@@ -1981,7 +1981,7 @@
                                                        if (fastcgi) {
                                                                goto 
fastcgi_request_done;
                                                        }
-                                                       
fclose(file_handle.handle.fp);
+                                                       
zend_file_handle_dtor(&file_handle TSRMLS_CC);
                                                        php_output_teardown();
                                                }
                                                return SUCCESS;
@@ -1992,7 +1992,7 @@
                                case PHP_MODE_INDENT:
                                        open_file_for_scanning(&file_handle 
TSRMLS_CC);
                                        zend_indent();
-                                       fclose(file_handle.handle.fp);
+                                       zend_file_handle_dtor(&file_handle 
TSRMLS_CC);
                                        php_output_teardown();
                                        return SUCCESS;
                                        break;
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.188&r2=1.189&diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.188 php-src/sapi/cli/php_cli.c:1.189
--- php-src/sapi/cli/php_cli.c:1.188    Tue Mar 25 21:58:03 2008
+++ php-src/sapi/cli/php_cli.c  Wed Mar 26 14:46:17 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_cli.c,v 1.188 2008/03/25 21:58:03 helly Exp $ */
+/* $Id: php_cli.c,v 1.189 2008/03/26 14:46:17 scottmac Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -566,6 +566,9 @@
 
        *lineno = 1;
 
+       file_handle->type = ZEND_HANDLE_FP;
+       file_handle->opened_path = NULL;
+       file_handle->free_filename = 0;
        if (!(file_handle->handle.fp = VCWD_FOPEN(script_file, "rb"))) {
                php_printf("Could not open input file: %s\n", script_file);
                return FAILURE;
@@ -1182,7 +1185,7 @@
                case PHP_MODE_INDENT:
                        open_file_for_scanning(&file_handle TSRMLS_CC);
                        zend_indent();
-                       fclose(file_handle.handle.fp);
+                       zend_file_handle_dtor(file_handle.handle TSRMLS_CC);
                        goto out;
                        break;
 #endif
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.44&r2=1.45&diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.44 php-src/win32/build/Makefile:1.45
--- php-src/win32/build/Makefile:1.44   Sun Mar  4 00:41:36 2007
+++ php-src/win32/build/Makefile        Wed Mar 26 14:46:17 2008
@@ -14,13 +14,14 @@
 #  | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
 #  +----------------------------------------------------------------------+
 #
-# $Id: Makefile,v 1.44 2007/03/04 00:41:36 edink Exp $
+# $Id: Makefile,v 1.45 2008/03/26 14:46:17 scottmac Exp $
 # This is the makefile template for the win32 build
 
 CC="$(CL)"
 LD="$(LINK)"
 MC="$(MC)"
 MT="$(MT)"
+RE2C="$(RE2C)"
 
 MCFILE=$(BUILD_DIR)\wsyslog.rc
 
@@ -28,10 +29,16 @@
 
 build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB)
 
+!if $(RE2C) == ""
+generated_files: build_dirs Zend\zend_ini_parser.c \
+       Zend\zend_language_parser.c \
+       $(PHPDEF) $(MCFILE)
+!else
 generated_files: build_dirs Zend\zend_ini_parser.c \
        Zend\zend_language_parser.c Zend\zend_ini_scanner.c \
        Zend\zend_language_scanner.c \
        $(PHPDEF) $(MCFILE)
+!endif
 
 $(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES)
        type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def
@@ -42,11 +49,13 @@
 Zend\zend_language_parser.c Zend\zend_language_parser.h: 
Zend\zend_language_parser.y
        $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend 
Zend/zend_language_parser.y
 
+!if $(RE2C) != ""
 Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l
-       $(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c 
Zend/zend_ini_scanner.l
+       $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
 
 Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l
-       $(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c 
Zend/zend_language_scanner.l
+       $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c 
Zend/zend_language_scanner.l
+!endif
 
 PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res
 
http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.70&r2=1.71&diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.70 php-src/win32/build/config.w32:1.71
--- php-src/win32/build/config.w32:1.70 Thu Jan 24 18:08:23 2008
+++ php-src/win32/build/config.w32      Wed Mar 26 14:46:17 2008
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.70 2008/01/24 18:08:23 dmitry Exp $
+// $Id: config.w32,v 1.71 2008/03/26 14:46:17 scottmac Exp $
 // "Master" config file; think of it as a configure.in
 // equivalent.
 
@@ -56,10 +56,40 @@
 if (!PATH_PROG('bison')) {
        ERROR('bison is required')
 }
-if (!PATH_PROG('flex')) {
-       ERROR('flex is required')
+
+// There's a minimum requirement for re2c..
+MINRE2C = "0.13.4";
+
+function probe_re2c_version(RE2C)
+{
+       var command = "cmd /c " + RE2C + " -v";
+       var version = execute(command + '" 2>&1"');
+
+       if (version.match(/((\d+)\.(\d+)\.(\d+))/)) {
+               return RegExp.$1;
+       }
+       return 0;
+}
+
+RE2C = PATH_PROG('re2c');
+if (RE2C) {
+       var intvers, intmin;
+       var pattern = /\./g;
+
+       RE2CVERS = probe_re2c_version(RE2C);
+       intvers = RE2CVERS.replace(pattern, '') - 0;
+       intmin = MINRE2C.replace(pattern, '') - 0;
+
+       if (intvers < intmin) {
+               STDOUT.WriteLine('WARNING: The minimum RE2C version requirement 
is ' + MINRE2C + ', ' + RE2CVERS + ' detected');
+               STDOUT.WriteLine('Parsers will not be generated. Upgrade your 
copy at http://sf.net/projects/re2c');
+               DEFINE('RE2C', '');
+       } else {
+               DEFINE('RE2C_FLAGS', '');
+       }
+} else {
+       STDOUT.WriteLine('Parsers will not be regenerated');
 }
-PATH_PROG('re2c');
 PATH_PROG('zip');
 PATH_PROG('lemon');
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to