]> granicus.if.org Git - php/commitdiff
Better shared code
authorZeev Suraski <zeev@php.net>
Mon, 6 Aug 2001 14:26:05 +0000 (14:26 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 6 Aug 2001 14:26:05 +0000 (14:26 +0000)
Zend/flex.skl
Zend/zend_highlight.c

index d84fa3dd6abd319282a77658d1b33d00ba3dd8a3..596c6dcddfa8d59657f59883f375eccd25a6ebc4 100644 (file)
@@ -229,8 +229,6 @@ static char yy_hold_char;
 
 static int yy_n_chars;         /* number of characters read into yy_ch_buf */
 
-int yyleng;
-
 /* Points to current character in buffer. */
 #define yy_c_buf_p SCNG(c_buf_p)
 #define yy_init SCNG(init)
@@ -292,14 +290,12 @@ static void yy_flex_free YY_PROTO(( void * ));
 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
 
 %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
-#ifdef ZTS
 #undef yyleng
 #define yyleng SCNG(yy_leng)
 #undef yytext
 #define yytext SCNG(yy_text)
 #undef yytext_ptr
 #define yytext_ptr SCNG(yy_text)
-#endif
 
 
 %- Standard (non-C++) definition
index 5fde390a7a90dae469fec551f75e745bc4633df7..ec1417532071d097afea3c62a777d8b48eb7a4d8 100644 (file)
 #include "zend_ptr_stack.h"
 #include "zend_globals.h"
 
-#ifndef ZTS
-extern char *zendtext;
-extern int zendleng;
-#else
-#define zendtext LANG_SCNG(yy_text)
-#define zendleng LANG_SCNG(yy_leng)
-#endif
-
 ZEND_API void zend_html_putc(char c)
 {
        switch (c) {
@@ -116,7 +108,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
                                in_string = !in_string;
                                break;                          
                        case T_WHITESPACE:
-                               zend_html_puts(zendtext, zendleng);  /* no color needed */
+                               zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));  /* no color needed */
                                token.type = 0;
                                continue;
                                break;
@@ -147,7 +139,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
                                zend_html_puts(token.value.str.val, token.value.str.len);
                                break;
                        default:
-                               zend_html_puts(zendtext, zendleng);
+                               zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
                                break;
                }