Skip to content

Commit af49e58

Browse files
author
Jani Taskinen
committed
- Reverted r296062 and r296065
1 parent ea539c8 commit af49e58

File tree

108 files changed

+3344
-4038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+3344
-4038
lines changed

README.NEW-OUTPUT-API

-142
This file was deleted.

Zend/zend_highlight.c

+22-23
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "zend_ptr_stack.h"
2727
#include "zend_globals.h"
2828

29-
ZEND_API void zend_html_putc(char c) /* {{{ */
29+
ZEND_API void zend_html_putc(char c)
3030
{
3131
switch (c) {
3232
case '\n':
@@ -52,9 +52,9 @@ ZEND_API void zend_html_putc(char c) /* {{{ */
5252
break;
5353
}
5454
}
55-
/* }}} */
5655

57-
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC) /* {{{ */
56+
57+
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
5858
{
5959
const char *ptr=s, *end=s+len;
6060

@@ -85,9 +85,9 @@ ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC) /* {{{ */
8585
}
8686
#endif /* ZEND_MULTIBYTE */
8787
}
88-
/* }}} */
8988

90-
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) /* {{{ */
89+
90+
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
9191
{
9292
zval token;
9393
int token_type;
@@ -97,7 +97,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
9797
zend_printf("<code>");
9898
zend_printf("<span style=\"color: %s\">\n", last_color);
9999
/* highlight stuff coming back from zendlex() */
100-
Z_TYPE(token) = 0;
100+
token.type = 0;
101101
while ((token_type=lex_scan(&token TSRMLS_CC))) {
102102
switch (token_type) {
103103
case T_INLINE_HTML:
@@ -121,11 +121,11 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
121121
break;
122122
case T_WHITESPACE:
123123
zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC); /* no color needed */
124-
Z_TYPE(token) = 0;
124+
token.type = 0;
125125
continue;
126126
break;
127127
default:
128-
if (Z_TYPE(token) == 0) {
128+
if (token.type == 0) {
129129
next_color = syntax_highlighter_ini->highlight_keyword;
130130
} else {
131131
next_color = syntax_highlighter_ini->highlight_default;
@@ -145,7 +145,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
145145

146146
zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
147147

148-
if (Z_TYPE(token) == IS_STRING) {
148+
if (token.type == IS_STRING) {
149149
switch (token_type) {
150150
case T_OPEN_TAG:
151151
case T_OPEN_TAG_WITH_ECHO:
@@ -155,13 +155,13 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
155155
case T_DOC_COMMENT:
156156
break;
157157
default:
158-
efree(Z_STRVAL(token));
158+
efree(token.value.str.val);
159159
break;
160160
}
161161
} else if (token_type == T_END_HEREDOC) {
162-
efree(Z_STRVAL(token));
162+
efree(token.value.str.val);
163163
}
164-
Z_TYPE(token) = 0;
164+
token.type = 0;
165165
}
166166

167167
if (last_color != syntax_highlighter_ini->highlight_html) {
@@ -170,15 +170,14 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
170170
zend_printf("</span>\n");
171171
zend_printf("</code>");
172172
}
173-
/* }}} */
174173

175-
ZEND_API void zend_strip(TSRMLS_D) /* {{{ */
174+
ZEND_API void zend_strip(TSRMLS_D)
176175
{
177176
zval token;
178177
int token_type;
179178
int prev_space = 0;
180179

181-
Z_TYPE(token) = 0;
180+
token.type = 0;
182181
while ((token_type=lex_scan(&token TSRMLS_CC))) {
183182
switch (token_type) {
184183
case T_WHITESPACE:
@@ -189,27 +188,27 @@ ZEND_API void zend_strip(TSRMLS_D) /* {{{ */
189188
/* lack of break; is intentional */
190189
case T_COMMENT:
191190
case T_DOC_COMMENT:
192-
Z_TYPE(token) = 0;
191+
token.type = 0;
193192
continue;
194-
193+
195194
case T_END_HEREDOC:
196195
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
197-
efree(Z_STRVAL(token));
196+
efree(token.value.str.val);
198197
/* read the following character, either newline or ; */
199198
if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
200199
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
201200
}
202201
zend_write("\n", sizeof("\n") - 1);
203202
prev_space = 1;
204-
Z_TYPE(token) = 0;
203+
token.type = 0;
205204
continue;
206205

207206
default:
208207
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
209208
break;
210209
}
211210

212-
if (Z_TYPE(token) == IS_STRING) {
211+
if (token.type == IS_STRING) {
213212
switch (token_type) {
214213
case T_OPEN_TAG:
215214
case T_OPEN_TAG_WITH_ECHO:
@@ -220,14 +219,13 @@ ZEND_API void zend_strip(TSRMLS_D) /* {{{ */
220219
break;
221220

222221
default:
223-
efree(Z_STRVAL(token));
222+
efree(token.value.str.val);
224223
break;
225224
}
226225
}
227-
prev_space = Z_TYPE(token) = 0;
226+
prev_space = token.type = 0;
228227
}
229228
}
230-
/* }}} */
231229

232230
/*
233231
* Local variables:
@@ -236,3 +234,4 @@ ZEND_API void zend_strip(TSRMLS_D) /* {{{ */
236234
* indent-tabs-mode: t
237235
* End:
238236
*/
237+

Zend/zend_indent.c

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@
3030
#define zendtext LANG_SCNG(yy_text)
3131
#define zendleng LANG_SCNG(yy_leng)
3232

33-
static void handle_whitespace(unsigned int *emit_whitespace) /* {{{ */
33+
34+
static void handle_whitespace(int *emit_whitespace)
3435
{
3536
unsigned char c;
36-
unsigned int i;
37+
int i;
3738

3839
for (c=0; c<128; c++) {
3940
if (emit_whitespace[c]>0) {
@@ -44,29 +45,29 @@ static void handle_whitespace(unsigned int *emit_whitespace) /* {{{ */
4445
}
4546
memset(emit_whitespace, 0, sizeof(int)*256);
4647
}
47-
/* }}} */
4848

49-
ZEND_API void zend_indent(void) /* {{{ */
49+
50+
ZEND_API void zend_indent()
5051
{
5152
zval token;
5253
int token_type;
5354
int in_string=0;
54-
unsigned int nest_level=0;
55-
unsigned int emit_whitespace[256];
56-
unsigned int i;
55+
int nest_level=0;
56+
int emit_whitespace[256];
57+
int i;
5758
TSRMLS_FETCH();
5859

5960
memset(emit_whitespace, 0, sizeof(int)*256);
6061

6162
/* highlight stuff coming back from zendlex() */
62-
Z_TYPE(token) = 0;
63+
token.type = 0;
6364
while ((token_type=lex_scan(&token TSRMLS_CC))) {
6465
switch (token_type) {
6566
case T_INLINE_HTML:
6667
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
6768
break;
6869
case T_WHITESPACE: {
69-
Z_TYPE(token) = 0;
70+
token.type = 0;
7071
/* eat whitespace, emit newlines */
7172
for (i=0; i<LANG_SCNG(yy_leng); i++) {
7273
emit_whitespace[(unsigned char) LANG_SCNG(yy_text)[i]]++;
@@ -78,7 +79,7 @@ ZEND_API void zend_indent(void) /* {{{ */
7879
in_string = !in_string;
7980
/* break missing intentionally */
8081
default:
81-
if (Z_TYPE(token)==0) {
82+
if (token.type==0) {
8283
/* keyword */
8384
switch (token_type) {
8485
case ',':
@@ -131,21 +132,20 @@ ZEND_API void zend_indent(void) /* {{{ */
131132
}
132133
break;
133134
}
134-
if (Z_TYPE(token) == IS_STRING) {
135+
if (token.type == IS_STRING) {
135136
switch (token_type) {
136137
case T_OPEN_TAG:
137138
case T_CLOSE_TAG:
138139
case T_WHITESPACE:
139140
break;
140141
default:
141-
efree(Z_STRVAL(token));
142+
efree(token.value.str.val);
142143
break;
143144
}
144145
}
145-
Z_TYPE(token) = 0;
146+
token.type = 0;
146147
}
147148
}
148-
/* }}} */
149149

150150
/*
151151
* Local variables:

0 commit comments

Comments
 (0)