From ff4cc2c6e2547f12a7e8d5516403efb6c076fe8d Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Tue, 11 Dec 2001 06:30:30 +0000 Subject: [PATCH] MFZE1 (added zend_strip mode in the highliter) --- Zend/zend_highlight.c | 61 +++++++++++++++++++++++++++++++++++++++++++ Zend/zend_highlight.h | 1 + 2 files changed, 62 insertions(+) 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