diff options
author | Márcio Almada <marcio3w@gmail.com> | 2015-04-05 08:50:35 -0300 |
---|---|---|
committer | Márcio Almada <marcio3w@gmail.com> | 2015-04-30 03:03:29 -0300 |
commit | 110759386e2f9b4d88bf68c669b6c54ad4b5c04f (patch) | |
tree | c0dc58e312c77662a5f6e10941408560a4b440ac /Zend/zend_language_scanner.h | |
parent | 02a9eb4f8c736089808b51d862def0e648383e09 (diff) | |
download | php-git-110759386e2f9b4d88bf68c669b6c54ad4b5c04f.tar.gz |
ext tokenizer port + cleanup unused lexer states
we basically added a mechanism to store the token stream during parsing
and exposed the entire parser stack on the tokenizer extension through
an opt in flag: token_get_all($src, TOKEN_PARSE).
this change allows easy future language enhancements regarding context
aware parsing & scanning without further maintance on the tokenizer
extension while solves known inconsistencies "parseless" tokenizer
extension has when it handles `__halt_compiler()` presence.
Diffstat (limited to 'Zend/zend_language_scanner.h')
-rw-r--r-- | Zend/zend_language_scanner.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index c82b3069c5..3b75ff8cc4 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -50,6 +50,9 @@ typedef struct _zend_lex_state { zend_encoding_filter output_filter; const zend_encoding *script_encoding; + /* hooks */ + void (* on_event)(zend_php_scanner_event event, int token, int line); + zend_ast *ast; zend_arena *ast_arena; } zend_lex_state; @@ -66,6 +69,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state); ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename); ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding); ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding); +ZEND_API void zend_lex_tstring(zval *zv); END_EXTERN_C() |