diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-14 23:41:32 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-14 23:41:32 +0000 |
commit | fac8eaff1a07823fd0fa2e54ef7796d7a9e40307 (patch) | |
tree | 1d8f3e3f6b1d8e488bbe9358fcb5c2a5b52819ba | |
parent | 9618e4e8540b809d6f8dc409c408de12fd41851b (diff) | |
download | php-git-fac8eaff1a07823fd0fa2e54ef7796d7a9e40307.tar.gz |
MFZE1
-rw-r--r-- | Zend/zend_globals.h | 1 | ||||
-rw-r--r-- | Zend/zend_ini_parser.y | 1 | ||||
-rw-r--r-- | Zend/zend_ini_scanner.l | 16 |
3 files changed, 12 insertions, 6 deletions
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 2be5df282a..9ca3aa24e5 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -252,6 +252,7 @@ struct _zend_scanner_globals { char *c_buf_p; int init; int start; + int lineno; char _yy_hold_char; int yy_n_chars; int _yy_did_buffer_switch_on_eof; diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 23f4054e09..f591debab6 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -57,7 +57,6 @@ zval yylval; #ifndef ZTS extern int ini_lex(zval *ini_lval TSRMLS_DC); extern FILE *ini_in; -extern int ini_lineno; extern void init_cfg_scanner(void); #endif diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index fe14e92b69..65aa9e5781 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -49,15 +49,15 @@ ZEND_API zend_scanner_globals ini_scanner_globals; static char *ini_filename; -void init_ini_scanner() +void init_ini_scanner(TSRMLS_D) { - ini_lineno=1; + SCNG(lineno)=1; } int zend_ini_scanner_get_lineno(TSRMLS_D) { - return ini_lineno; + return SCNG(lineno); } @@ -83,7 +83,7 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) return FAILURE; } - init_ini_scanner(); + init_ini_scanner(TSRMLS_C); yyin = fp; yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); ini_filename = fh->filename; @@ -105,7 +105,6 @@ void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) NEWLINE ("\r"|"\n"|"\r\n") %option noyywrap -%option yylineno %% @@ -134,6 +133,8 @@ NEWLINE ("\r"|"\n"|"\r\n") yytext[yyleng]=0; } + SCNG(lineno)++; + /* eat leading [ */ yytext++; yyleng--; @@ -200,15 +201,20 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>[=\n] { + if (yytext[0] == '\n') { + SCNG(lineno)++; + } return yytext[0]; } <INITIAL>{NEWLINE} { + SCNG(lineno)++; return '\n'; } <INITIAL>[;][^\r\n]*{NEWLINE}? { /* comment */ + SCNG(lineno)++; return '\n'; } |