diff options
author | Nikita Popov <nikic@php.net> | 2015-07-09 22:59:31 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-07-09 23:02:21 +0200 |
commit | a49ce7bb91bec02d6f26b3118404371df23242fe (patch) | |
tree | a6b240dd25820ccd6f1b2109a19814f2bf34f488 /ext/tokenizer/tokenizer.c | |
parent | fc5c7e633b35f76df405471b119984fbf6354b41 (diff) | |
download | php-git-a49ce7bb91bec02d6f26b3118404371df23242fe.tar.gz |
Don't return T_ERROR from token_get_all()
This turned out to be rather inconvenient after all. Instead just
return the same output we did on PHP 5. If people want to have an
error, use TOKEN_PARSE.
Diffstat (limited to 'ext/tokenizer/tokenizer.c')
-rw-r--r-- | ext/tokenizer/tokenizer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index a8d1bff134..50b47835dd 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -191,9 +191,9 @@ void on_event(zend_php_scanner_event event, int token, int line) HashTable *tokens_ht; zval *token_zv; - switch(event) { + switch (event) { case ON_TOKEN: - if (token == T_ERROR || token == END) break; + if (token == END) break; if (token >= 256) { array_init(&keyword); add_next_index_long(&keyword, token); @@ -281,7 +281,7 @@ PHP_FUNCTION(token_get_all) success = tokenize_parse(return_value, source); } else { success = tokenize(return_value, source); - /* Normal token_get_all() should never throw. Errors are indicated by T_ERROR tokens. */ + /* Normal token_get_all() should not throw. */ zend_clear_exception(); } |