summaryrefslogtreecommitdiff
path: root/ext/tokenizer/tokenizer.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2007-04-08 00:18:38 +0000
committerJohannes Schlüter <johannes@php.net>2007-04-08 00:18:38 +0000
commit8591b20d4ee289d99cb8caba41e6a1beff7a237d (patch)
treecf29ee43e16a32ebc821ba2b54fe682208e00cda /ext/tokenizer/tokenizer.c
parentd428314e2d006932589073f974e5519d1a2900ed (diff)
downloadphp-git-8591b20d4ee289d99cb8caba41e6a1beff7a237d.tar.gz
- MFH: 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 a500f88712..7df3439b1e 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;
array_init(return_value);
@@ -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);
}
}