CVS update: php3
| From: | sas | Date: | Sun, 27 Dec 1998 10:16:22 +0000 |
| Subject: | CVS update: php3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3065@lists.php.net to get a copy of this message | ||
Date: Sunday December 27, 1998 @ 5:16
Author: sas
Update of /repository/php3
In directory asf:/u/temp/cvs-serv12279
Modified Files:
configure.in acconfig.h language-scanner.lex
Log Message:
speed up scanner up to 5% (depends very much on your input data)
this adds an option which disables displaying source output
it changes absolute nothing, if not told otherwise
Index: php3/configure.in
diff -c php3/configure.in:1.297 php3/configure.in:1.298
*** php3/configure.in:1.297 Sun Dec 27 02:09:45 1998
--- php3/configure.in Sun Dec 27 05:16:21 1998
***************
*** 1,4 ****
! dnl $Id: configure.in,v 1.297 1998/12/27 07:09:45 sas Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
--- 1,4 ----
! dnl $Id: configure.in,v 1.298 1998/12/27 10:16:21 sas Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
***************
*** 1891,1896 ****
--- 1891,1910 ----
AC_MSG_RESULT(no)
])
+ AC_MSG_CHECKING(whether to enable displaying source support)
+ AC_ARG_ENABLE(display-source,
+ [ --disable-display-source Compile without displaying source support],[
+ if test "$enableval" = "yes"; then
+ AC_DEFINE(HAVE_DISPLAY_SOURCE, 1)
+ AC_MSG_RESULT(yes)
+ else
+ AC_DEFINE(HAVE_DISPLAY_SOURCE, 0)
+ AC_MSG_RESULT(no)
+ fi
+ ],[
+ AC_DEFINE(HAVE_DISPLAY_SOURCE, 1)
+ AC_MSG_RESULT(yes)
+ ])
dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2.
test -n "$auto_cflags" && test -n "$GCC" &&
CFLAGS="$CFLAGS -O2"
Index: php3/acconfig.h
diff -c php3/acconfig.h:1.74 php3/acconfig.h:1.75
*** php3/acconfig.h:1.74 Sun Dec 27 02:09:43 1998
--- php3/acconfig.h Sun Dec 27 05:16:21 1998
***************
*** 243,252 ****
*/
#define HAVE_SEMUN 0
! /* Define if you want System V shared memory support.
! */
#define HAVE_SYSVSHM 0
/* Define if you have broken header files like SunOS 4 */
#define MISSING_FCLOSE_DECL 0
--- 243,253 ----
*/
#define HAVE_SEMUN 0
! /* Define if you want System V shared memory support. */
#define HAVE_SYSVSHM 0
+ /* Define if you want to enable displaying source support. */
+ #define HAVE_DISPLAY_SOURCE 0
/* Define if you have broken header files like SunOS 4 */
#define MISSING_FCLOSE_DECL 0
Index: php3/language-scanner.lex
diff -c php3/language-scanner.lex:1.176 php3/language-scanner.lex:1.177
*** php3/language-scanner.lex:1.176 Sat Oct 17 14:17:26 1998
--- php3/language-scanner.lex Sun Dec 27 05:16:21 1998
***************
*** 95,100 ****
--- 95,107 ----
#define BEGIN_STRONG() { PUTS("<STRONG>"); }
#define END_STRONG() { PUTS("</STRONG>"); }
+ #if HAVE_DISPLAY_SOURCE
+ #define IF_DISPLAY_SOURCE(a) \
+ if (GLOBAL(php3_display_source)) { a }
+ #else
+ #define IF_DISPLAY_SOURCE(a) if(0) { }
+ #endif
+
#define HANDLE_NEWLINES(s,l) \
do { \
char *p = (s),*boundary = p+(l); \
***************
*** 804,813 ****
_php3_hash_environment();
}
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! }
HANDLE_NEWLINES(yytext,yyleng);
} else {
phplval->value.str.val = (char *) estrndup(yytext, yyleng);
--- 811,820 ----
_php3_hash_environment();
}
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! )
HANDLE_NEWLINES(yytext,yyleng);
} else {
phplval->value.str.val = (char *) estrndup(yytext, yyleng);
***************
*** 824,833 ****
_php3_hash_environment();
}
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! }
if (yyleng==3) { /* this tag is <%=, implicit echo */
return PHP_ECHO;
}
--- 831,840 ----
_php3_hash_environment();
}
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! )
if (yyleng==3) { /* this tag is <%=, implicit echo */
return PHP_ECHO;
}
***************
*** 847,865 ****
_php3_hash_environment();
}
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! }
}
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
GLOBAL(php3_track_vars)=1;
HANDLE_NEWLINE(yytext[yyleng-1]);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! }
}
--- 854,872 ----
_php3_hash_environment();
}
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! )
}
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
GLOBAL(php3_track_vars)=1;
HANDLE_NEWLINE(yytext[yyleng-1]);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_default);
html_puts(yytext,yyleng);
! )
}
***************
*** 898,912 ****
<IN_PHP>{WHITESPACE} {
HANDLE_NEWLINES(yytext,yyleng);
! if (GLOBAL(php3_display_source)) {
html_puts(yytext, yyleng);
! }
}
<IN_PHP>([#]|"//")([^\n\r?]|"?"[^>\n\r])*("?\n"|"?\r\n")?
{ /* eat one line comments */
HANDLE_NEWLINE(yytext[yyleng-1]);
! if (GLOBAL(php3_display_source)) {
END_COLOR();
BEGIN_ITALIC();
BEGIN_COLOR_SIZE(php3_ini.highlight_comment, "-1");
--- 905,919 ----
<IN_PHP>{WHITESPACE} {
HANDLE_NEWLINES(yytext,yyleng);
! IF_DISPLAY_SOURCE(
html_puts(yytext, yyleng);
! )
}
<IN_PHP>([#]|"//")([^\n\r?]|"?"[^>\n\r])*("?\n"|"?\r\n")?
{ /* eat one line comments */
HANDLE_NEWLINE(yytext[yyleng-1]);
! IF_DISPLAY_SOURCE(
END_COLOR();
BEGIN_ITALIC();
BEGIN_COLOR_SIZE(php3_ini.highlight_comment, "-1");
***************
*** 914,920 ****
END_COLOR();
END_ITALIC();
BEGIN_COLOR(php3_ini.highlight_default);
! }
}
<IN_PHP>"/*" {
--- 921,927 ----
END_COLOR();
END_ITALIC();
BEGIN_COLOR(php3_ini.highlight_default);
! )
}
<IN_PHP>"/*" {
***************
*** 924,963 ****
start_lineno=GLOBAL(phplineno);
! if (GLOBAL(php3_display_source)) {
END_COLOR();
BEGIN_ITALIC();
BEGIN_COLOR_SIZE(php3_ini.highlight_comment, "-1");
html_puts(yytext,yyleng);
! }
for (;;) {
! if (GLOBAL(php3_display_source)) {
while((c=MY_INPUT())!='*' && c!=EOF) {
HANDLE_NEWLINE(c);
html_putc(c);
}
! } else {
while ((c=MY_INPUT())!='*' && c!=EOF) { /* eat up text of comment */
HANDLE_NEWLINE(c);
}
}
if (c=='*') {
! if (GLOBAL(php3_display_source)) {
html_putc(c);
while ((c=MY_INPUT())=='*') {
html_putc(c);
}
! } else {
while ((c=MY_INPUT())=='*');
}
! if (GLOBAL(php3_display_source)) {
html_putc(c);
! }
if (c=='/') {
! if (GLOBAL(php3_display_source)) {
END_COLOR(); END_ITALIC();
BEGIN_COLOR(php3_ini.highlight_default);
! }
break; /* found the end */
}
}
--- 931,970 ----
start_lineno=GLOBAL(phplineno);
! IF_DISPLAY_SOURCE(
END_COLOR();
BEGIN_ITALIC();
BEGIN_COLOR_SIZE(php3_ini.highlight_comment, "-1");
html_puts(yytext,yyleng);
! )
for (;;) {
! IF_DISPLAY_SOURCE(
while((c=MY_INPUT())!='*' && c!=EOF) {
HANDLE_NEWLINE(c);
html_putc(c);
}
! ) else {
while ((c=MY_INPUT())!='*' && c!=EOF) { /* eat up text of comment */
HANDLE_NEWLINE(c);
}
}
if (c=='*') {
! IF_DISPLAY_SOURCE(
html_putc(c);
while ((c=MY_INPUT())=='*') {
html_putc(c);
}
! ) else {
while ((c=MY_INPUT())=='*');
}
! IF_DISPLAY_SOURCE(
html_putc(c);
! )
if (c=='/') {
! IF_DISPLAY_SOURCE(
END_COLOR(); END_ITALIC();
BEGIN_COLOR(php3_ini.highlight_default);
! )
break; /* found the end */
}
}
***************
*** 974,983 ****
<IN_PHP>("?>"|"</script"{WHITESPACE}*">")([\n]|"\r\n")?
{
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(INITIAL);
! if (GLOBAL(php3_display_source)) {
html_puts(yytext,yyleng);
END_COLOR();
! }
return ';'; /* implicit ';' at php-end tag */
}
--- 981,990 ----
<IN_PHP>("?>"|"</script"{WHITESPACE}*">")([\n]|"\r\n")?
{
HANDLE_NEWLINE(yytext[yyleng-1]);
BEGIN(INITIAL);
! IF_DISPLAY_SOURCE(
html_puts(yytext,yyleng);
END_COLOR();
! )
return ';'; /* implicit ';' at php-end tag */
}
***************
*** 986,995 ****
HANDLE_NEWLINE(yytext[yyleng-1]);
if (php3_ini.asp_tags) {
BEGIN(INITIAL);
! if (GLOBAL(php3_display_source)) {
html_puts(yytext,yyleng);
END_COLOR();
! }
return ';'; /* implicit ';' at php-end tag */
} else {
phplval->value.str.val = (char *) estrndup(yytext, yyleng);
--- 993,1002 ----
HANDLE_NEWLINE(yytext[yyleng-1]);
if (php3_ini.asp_tags) {
BEGIN(INITIAL);
! IF_DISPLAY_SOURCE(
html_puts(yytext,yyleng);
END_COLOR();
! )
return ';'; /* implicit ';' at php-end tag */
} else {
phplval->value.str.val = (char *) estrndup(yytext, yyleng);
***************
*** 1003,1034 ****
<IN_PHP>["] {
BEGIN(DOUBLE_QUOTES);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! }
return '\"';
}
<IN_PHP>[`] {
BEGIN(BACKQUOTE);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! }
return '`';
}
<IN_PHP>['] {
BEGIN(SINGLE_QUOTE);
! if (GLOBAL(php3_display_source)) {
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! }
return '\'';
}
--- 1010,1041 ----
<IN_PHP>["] {
BEGIN(DOUBLE_QUOTES);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! )
return '\"';
}
<IN_PHP>[`] {
BEGIN(BACKQUOTE);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! )
return '`';
}
<IN_PHP>['] {
BEGIN(SINGLE_QUOTE);
! IF_DISPLAY_SOURCE(
BEGIN_COLOR(php3_ini.highlight_string);
BEGIN_STRONG();
html_putc(yytext[0]);
! )
return '\'';
}
***************
*** 1144,1173 ****
<DOUBLE_QUOTES>["] {
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! }
return '\"';
}
<BACKQUOTE>[`] {
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! }
return '`';
}
<SINGLE_QUOTE>['] {
BEGIN(IN_PHP);
! if (GLOBAL(php3_display_source)) {
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! }
return '\'';
}
--- 1151,1180 ----
<DOUBLE_QUOTES>["] {
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! )
return '\"';
}
<BACKQUOTE>[`] {
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! )
return '`';
}
<SINGLE_QUOTE>['] {
BEGIN(IN_PHP);
! IF_DISPLAY_SOURCE(
html_putc(yytext[0]);
END_STRONG(); END_COLOR();
! )
return '\'';
}
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net