From: Sebastian Bergmann Date: Tue, 11 Dec 2001 06:30:30 +0000 (+0000) Subject: MFZE1 (added zend_strip mode in the highliter) X-Git-Tag: ChangeLog~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff4cc2c6e2547f12a7e8d5516403efb6c076fe8d;p=php MFZE1 (added zend_strip mode in the highliter) --- diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index ec14175320..3d2482c734 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -173,6 +173,67 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini zend_printf(""); } + + +ZEND_API void zend_strip(TSRMLS_D) +{ + zval token; + int token_type; + + token.type = 0; + while ((token_type=lex_scan(&token TSRMLS_CC))) { + switch (token_type) { + case T_COMMENT: + token.type = 0; + break; + + case T_WHITESPACE: + if (token.type) { + putchar(' '); + token.type = 0; + } + continue; + } + + switch (token_type) { + case 349: + break; + + default: { + char c, *ptr=LANG_SCNG(yy_text), *end=LANG_SCNG(yy_text)+LANG_SCNG(yy_leng); + while (ptr