diff options
author | Johannes Schlüter <johannes@php.net> | 2007-04-08 00:17:40 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2007-04-08 00:17:40 +0000 |
commit | c3b395d83adbec27d00bd686a2072cf626d263e2 (patch) | |
tree | e36c1c70f6d1269c157b9b356d91c66355722085 /ext/tokenizer/tokenizer.c | |
parent | 7e75dcbe5ac177f9748441e5eb0594420a5d08ec (diff) | |
download | php-git-c3b395d83adbec27d00bd686a2072cf626d263e2.tar.gz |
- Added linenumbers to array returned by token_get_all()
Diffstat (limited to 'ext/tokenizer/tokenizer.c')
-rw-r--r-- | ext/tokenizer/tokenizer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 95b009a105..3727ec0a49 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -272,6 +272,7 @@ static void tokenize(zval *return_value TSRMLS_DC) zval *keyword; int token_type; zend_bool destroy; + int token_line = 1; CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; @@ -301,6 +302,7 @@ static void tokenize(zval *return_value TSRMLS_DC) } else { add_next_index_stringl(keyword, zendtext, zendleng, 1); } + add_next_index_long(keyword, token_line); add_next_index_zval(return_value, keyword); } else { add_next_index_stringl(return_value, zendtext, zendleng, 1); @@ -309,6 +311,8 @@ static void tokenize(zval *return_value TSRMLS_DC) zval_dtor(&token); } ZVAL_NULL(&token); + + token_line = CG(zend_lineno); } } |