summaryrefslogtreecommitdiff
path: root/Zend/zend_language_scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_language_scanner.l')
-rw-r--r--Zend/zend_language_scanner.l18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 4482214082..7cd266fd39 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -494,6 +494,20 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
}
+ZEND_API int zend_get_scanned_file_offset(TSRMLS_D)
+{
+ if (yyin) {
+ int offset_in_buffer = (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf);
+ int read_bytes = (YY_CURRENT_BUFFER)->yy_n_chars;
+ int offset_from_the_end = read_bytes - offset_in_buffer;
+
+ return zend_stream_ftell(yyin TSRMLS_CC) - offset_from_the_end;
+ } else {
+ return -1;
+ }
+}
+
+
zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
{
zend_lex_state original_lex_state;
@@ -1015,6 +1029,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_EMPTY;
}
+<ST_IN_SCRIPTING>"__halt_compiler" {
+ return T_HALT_COMPILER;
+}
+
<ST_IN_SCRIPTING>"static" {
return T_STATIC;
}