summaryrefslogtreecommitdiff
path: root/ext/tokenizer/tokenizer.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-04-08 00:17:40 +0000
committerJohannes Schlüter <johannes@php.net>2007-04-08 00:17:40 +0000
commitc3b395d83adbec27d00bd686a2072cf626d263e2 (patch)
treee36c1c70f6d1269c157b9b356d91c66355722085 /ext/tokenizer/tokenizer.c
parent7e75dcbe5ac177f9748441e5eb0594420a5d08ec (diff)
downloadphp-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.c4
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);
}
}