CVS update: php31/main
| From: | zeev | Date: | Fri, 21 Aug 1998 03:48:57 +0000 |
| Subject: | CVS update: php31/main | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-398@lists.php.net to get a copy of this message | ||
Date: Thursday August 20, 1998 @ 23:48
Author: zeev
Update of /repository/php31/main
In directory asf:/tmp/cvs-serv20527/main
Modified Files:
control_structures_inline.h language-parser.y
language-scanner.l main.c php.h token_cache.c
Log Message:
Remove DONE_EVAL crap, about time. It *should* work fine now w/o it.
Apply a missing change from the 3.0 tree (end_current_file_execution() wasn't being used).
Index: php31/main/control_structures_inline.h
diff -c php31/main/control_structures_inline.h:2.6 php31/main/control_structures_inline.h:2.7
*** php31/main/control_structures_inline.h:2.6 Thu Aug 20 22:12:55 1998
--- php31/main/control_structures_inline.h Thu Aug 20 23:48:56 1998
***************
*** 29,35 ****
*/
! /* $Id: control_structures_inline.h,v 2.6 1998/08/21 02:12:55 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 29,35 ----
*/
! /* $Id: control_structures_inline.h,v 2.7 1998/08/21 03:48:56 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 665,671 ****
} else {
int retval;
! if (end_current_file_execution(&retval _INLINE_TLS) && retval==0) {
/* the scanner return 0, terminate execution completely (behave like exit()) */
php3_header();
GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN;
--- 665,671 ----
} else {
int retval;
! if (!end_current_file_execution(_INLINE_TLS_VOID)) {
/* the scanner return 0, terminate execution completely (behave like exit()) */
php3_header();
GLOBAL(shutdown_requested) = ABNORMAL_SHUTDOWN;
Index: php31/main/language-parser.y
diff -c php31/main/language-parser.y:2.4 php31/main/language-parser.y:2.5
*** php31/main/language-parser.y:2.4 Thu Aug 20 22:12:55 1998
--- php31/main/language-parser.y Thu Aug 20 23:48:56 1998
***************
*** 31,37 ****
*/
! /* $Id: language-parser.y,v 2.4 1998/08/21 02:12:55 zeev Exp $ */
/*
--- 31,37 ----
*/
! /* $Id: language-parser.y,v 2.5 1998/08/21 03:48:56 zeev Exp $ */
/*
***************
*** 261,267 ****
%token PHP_ARRAY
%token VAR
%token EVAL
- %token DONE_EVAL
%token PHP_LINE
%token PHP_FILE
%token STRING_CONSTANT
--- 261,266 ----
Index: php31/main/language-scanner.l
diff -c php31/main/language-scanner.l:2.3 php31/main/language-scanner.l:2.4
*** php31/main/language-scanner.l:2.3 Thu Aug 20 22:12:55 1998
--- php31/main/language-scanner.l Thu Aug 20 23:48:56 1998
***************
*** 290,301 ****
return SUCCESS;
}
! int end_current_file_execution(int *retval INLINE_TLS)
{
YY_TLS_VARS
if (stack_is_empty(&GLOBAL(input_source_stack))) {
! *retval = 0;
! return 1;
} else {
PHPLexState *lex_state;
--- 290,301 ----
return SUCCESS;
}
! /* returns 0 if scanning should be terminated */
! int end_current_file_execution(INLINE_TLS_VOID)
{
YY_TLS_VARS
if (stack_is_empty(&GLOBAL(input_source_stack))) {
! return 0;
} else {
PHPLexState *lex_state;
***************
*** 321,327 ****
BEGIN(lex_state->state);
yy_switch_to_buffer(lex_state->buffer_state);
stack_del_top(&GLOBAL(input_source_stack));
- *retval = DONE_EVAL;
return 1;
break;
case LEX_STATE_EVAL: /* switching out of eval() */
--- 321,326 ----
***************
*** 330,336 ****
yy_switch_to_buffer(lex_state->buffer_state);
STR_FREE(lex_state->eval_string);
stack_del_top(&GLOBAL(input_source_stack));
- *retval = DONE_EVAL;
return 1;
break;
case LEX_STATE_HIGHLIGHT_STRING:
--- 329,334 ----
***************
*** 366,374 ****
yy_switch_to_buffer(lex_state->buffer_state);
stack_del_top(&GLOBAL(input_source_stack));
break;
- }
}
! return 0;
}
--- 364,372 ----
yy_switch_to_buffer(lex_state->buffer_state);
stack_del_top(&GLOBAL(input_source_stack));
break;
}
! }
! return 1;
}
***************
*** 1127,1206 ****
<DOUBLE_QUOTES,BACKQUOTE,INITIAL,IN_PHP><<EOF>> {
! if (stack_is_empty(&GLOBAL(input_source_stack))) {
! yyterminate();
! } else {
! PHPLexState *lex_state;
!
! yy_delete_buffer(YY_CURRENT_BUFFER);
! stack_top(&GLOBAL(input_source_stack),(void **) &lex_state);
!
! GLOBAL(phplineno) = lex_state->lineno;
! GLOBAL(in_eval) = lex_state->in_eval;
!
! switch(lex_state->type) {
! case LEX_STATE_CONDITIONAL_INCLUDE: /* switching out of include() */
! seek_token(&GLOBAL(token_cache_manager),lex_state->return_offset);
! #if WIN32|WINNT
! if(yyin->_tmpfname=="url"){
! closesocket(yyin->_file);
! efree(yyin);
! } else {
! fclose(yyin);
! }
! #else
! fclose(yyin);
! #endif
! BEGIN(lex_state->state);
! yy_switch_to_buffer(lex_state->buffer_state);
! stack_del_top(&GLOBAL(input_source_stack));
! return DONE_EVAL;
! break;
! case LEX_STATE_EVAL: /* switching out of eval() */
! seek_token(&GLOBAL(token_cache_manager),lex_state->return_offset);
! BEGIN(lex_state->state);
! yy_switch_to_buffer(lex_state->buffer_state);
! STR_FREE(lex_state->eval_string);
! stack_del_top(&GLOBAL(input_source_stack));
! return DONE_EVAL;
! break;
! case LEX_STATE_HIGHLIGHT_STRING:
! GLOBAL(php3_display_source)=0;
! GLOBAL(ExecuteFlag) = stack_int_top(&GLOBAL(css));
! stack_del_top(&GLOBAL(css));
! GLOBAL(Execute) = SHOULD_EXECUTE;
! END_COLOR();
! BEGIN(lex_state->state);
! yy_switch_to_buffer(lex_state->buffer_state);
! STR_FREE(lex_state->eval_string);
! stack_del_top(&GLOBAL(input_source_stack));
! break;
! case LEX_STATE_HIGHLIGHT_FILE:
! GLOBAL(php3_display_source)=0;
! GLOBAL(ExecuteFlag) = stack_int_top(&GLOBAL(css));
! stack_del_top(&GLOBAL(css));
! GLOBAL(Execute) = SHOULD_EXECUTE;
! END_COLOR();
! /* break missing intentionally */
! case LEX_STATE_INCLUDE:
! #if WIN32|WINNT
! if (yyin->_tmpfname=="url") {
! closesocket(yyin->_file);
! efree(yyin);
! } else {
! fclose(yyin);
! }
! #else
! fclose(yyin);
! #endif
! BEGIN(lex_state->state);
! yy_switch_to_buffer(lex_state->buffer_state);
! stack_del_top(&GLOBAL(input_source_stack));
! break;
! }
}
}
-
<IN_PHP,INITIAL,DOUBLE_QUOTES,BACKQUOTE,SINGLE_QUOTE>. {
php3_error(E_WARNING,"Unexpected character in input: '%c' (ASCII=%d)
state=%d",yytext[0],yytext[0],YYSTATE);
--- 1125,1137 ----
<DOUBLE_QUOTES,BACKQUOTE,INITIAL,IN_PHP><<EOF>> {
! int retval;
! TLS_VARS;
!
! if (!end_current_file_execution(_INLINE_TLS_VOID)) {
! return 0;
}
}
<IN_PHP,INITIAL,DOUBLE_QUOTES,BACKQUOTE,SINGLE_QUOTE>. {
php3_error(E_WARNING,"Unexpected character in input: '%c' (ASCII=%d)
state=%d",yytext[0],yytext[0],YYSTATE);
Index: php31/main/main.c
diff -c php31/main/main.c:2.11 php31/main/main.c:2.12
*** php31/main/main.c:2.11 Thu Aug 20 22:12:55 1998
--- php31/main/main.c Thu Aug 20 23:48:56 1998
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: main.c,v 2.11 1998/08/21 02:12:55 zeev Exp $ */
/* #define CRASH_DETECTION */
--- 29,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: main.c,v 2.12 1998/08/21 03:48:56 zeev Exp $ */
/* #define CRASH_DETECTION */
***************
*** 399,411 ****
case FAILURE:
php3_error(E_ERROR, "Unable to read next token!\n");
return 0;
- break;
- case DONE_EVAL:
- #ifdef THREAD_SAFE
- return phplex(phplval, php3_globals, php_flex_gbl);
- #else
- return phplex(phplval);
- #endif
break;
}
*phplval = token->phplval;
--- 399,404 ----
Index: php31/main/php.h
diff -c php31/main/php.h:2.5 php31/main/php.h:2.6
*** php31/main/php.h:2.5 Thu Aug 20 17:50:31 1998
--- php31/main/php.h Thu Aug 20 23:48:56 1998
***************
*** 28,34 ****
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 2.5 1998/08/20 21:50:31 zeev Exp $ */
#ifndef _PHP_H
#define _PHP_H
--- 28,34 ----
+----------------------------------------------------------------------+
*/
! /* $Id: php.h,v 2.6 1998/08/21 03:48:56 zeev Exp $ */
#ifndef _PHP_H
#define _PHP_H
***************
*** 380,386 ****
extern int cfgparse(void);
extern void reset_scanner(void);
extern void html_putc(char c);
! extern int end_current_file_execution(int *retval INLINE_TLS);
/* functions */
#ifndef THREAD_SAFE
--- 380,386 ----
extern int cfgparse(void);
extern void reset_scanner(void);
extern void html_putc(char c);
! extern int end_current_file_execution(INLINE_TLS_VOID);
/* functions */
#ifndef THREAD_SAFE
Index: php31/main/token_cache.c
diff -c php31/main/token_cache.c:2.2 php31/main/token_cache.c:2.3
*** php31/main/token_cache.c:2.2 Thu Aug 20 22:12:56 1998
--- php31/main/token_cache.c Thu Aug 20 23:48:56 1998
***************
*** 29,35 ****
*/
! /* $Id: token_cache.c,v 2.2 1998/08/21 02:12:56 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
--- 29,35 ----
*/
! /* $Id: token_cache.c,v 2.3 1998/08/21 03:48:56 zeev Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
***************
*** 138,146 ****
phplval->cs_data.switched = 0;
next_token.token_type = lex_scan(phplval);
/*printf("Read token: %c (%d)\n",next_token.token_type,next_token.token_type);*/
- if (next_token.token_type == DONE_EVAL) {
- return DONE_EVAL;
- }
if (GLOBAL(tc)->count >= GLOBAL(tc)->max_tokens) { /* we need more memory */
GLOBAL(tc)->tokens = (Token *) erealloc(GLOBAL(tc)->tokens,
(sizeof(Token) * (GLOBAL(tc)->max_tokens += GLOBAL(tc)->block_size)));
--- 138,143 ----
--
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