Skip to content

Commit 2adc5e1

Browse files
committed
Fixed indents
1 parent 54fe897 commit 2adc5e1

File tree

5 files changed

+63
-42
lines changed

5 files changed

+63
-42
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
indent_style = tab
12+
indent_size = 4
13+
14+
[*.php]
15+
indent_style = space
16+
17+
[*.yml]
18+
indent_style = space
19+
20+
[*.md]
21+
indent_style = space

build-linux

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ RE2C_BIN=${RE2C_BIN:-$(command -v re2c 2>/dev/null)}
2525
rm -f *.o *.lo
2626

2727
if [ x"$CC" != x ]; then
28-
if [ x"$GCC_BIN" != x ]; then
29-
export CFLAGS="-g3 -O3 -fno-delete-null-pointer-checks -Wall -fvisibility=hidden"
30-
export CC="gcc"
31-
else
32-
if [ x"$CLANG_BIN" != x ]; then
33-
export CFLAGS="-g3 -O3 -fcolor-diagnostics"
34-
export CC="clang"
35-
fi
36-
fi
28+
if [ x"$GCC_BIN" != x ]; then
29+
export CFLAGS="-g3 -O3 -fno-delete-null-pointer-checks -Wall -fvisibility=hidden"
30+
export CC="gcc"
31+
else
32+
if [ x"$CLANG_BIN" != x ]; then
33+
export CFLAGS="-g3 -O3 -fcolor-diagnostics"
34+
export CC="clang"
35+
fi
36+
fi
3737
fi
3838

3939
if [ x"$CC" = x ]; then
40-
echo -e "error: unable to locate the compiler"
41-
exit 1
40+
echo -e "error: unable to locate the compiler"
41+
exit 1
4242
fi
4343

4444
if [ x"$RE2C_BIN" = x ]; then
@@ -52,21 +52,21 @@ ${RE2C_BIN} -o scanner.c scanner.re
5252

5353
# Compile lemon
5454
if [ ! -f lemon ]; then
55-
${CC} lemon.c -o lemon
55+
${CC} lemon.c -o lemon
5656
fi
5757

5858
echo -e "Generating PHP 5 parser..."
5959
./lemon -s parser.php5.lemon
6060
if [ ! -f parser.php5.c ]; then
61-
echo "error: couldn't generate parser"
62-
exit 2
61+
echo "error: couldn't generate parser"
62+
exit 2
6363
fi
6464
echo
6565

6666
./lemon -s parser.php7.lemon
6767
if [ ! -f parser.php7.c ]; then
68-
echo "error: couldn't generate parser"
69-
exit 2
68+
echo "error: couldn't generate parser"
69+
exit 2
7070
fi
7171
echo
7272

config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG_ENABLE("zephir_parser", "enable Zephir Parser", "no");
22

33
if (PHP_ZEPHIR_PARSER != "no") {
4-
EXTENSION("zephir_parser", "zephir_parser.c", null, "-I"+configure_module_dirname);
5-
ADD_SOURCES(configure_module_dirname + "/parser", "parser.c scanner.c", "zephir_parser");
4+
EXTENSION("zephir_parser", "zephir_parser.c", null, "-I"+configure_module_dirname);
5+
ADD_SOURCES(configure_module_dirname + "/parser", "parser.c scanner.c", "zephir_parser");
66
}

parser/lempar.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
/* Next is all token values, in a form suitable for use by makeheaders.
88
** This section will be null unless lemon is run with the -m switch.
99
*/
10-
/*
10+
/*
1111
** These constants (all generated automatically by the parser generator)
1212
** specify the various kinds of tokens (terminals) that the parser
13-
** understands.
13+
** understands.
1414
**
1515
** Each symbol here is a terminal symbol in the grammar.
1616
*/
@@ -28,7 +28,7 @@
2828
** and nonterminals. "int" is used otherwise.
2929
** YYNOCODE is a number of type YYCODETYPE which corresponds
3030
** to no legal terminal or nonterminal number. This
31-
** number is used to fill in empty slots of the hash
31+
** number is used to fill in empty slots of the hash
3232
** table.
3333
** YYFALLBACK If defined, this indicates that one or more tokens
3434
** have fall-back values which should be used if the
@@ -37,7 +37,7 @@
3737
** and nonterminal numbers. "unsigned char" is
3838
** used if there are fewer than 250 rules and
3939
** states combined. "int" is used otherwise.
40-
** ParseTOKENTYPE is the data type used for minor tokens given
40+
** ParseTOKENTYPE is the data type used for minor tokens given
4141
** directly to the parser from the tokenizer.
4242
** YYMINORTYPE is the data type used for all minor tokens.
4343
** This is typically a union of many types, one of
@@ -61,7 +61,7 @@
6161
/* Next are that tables used to determine what action to take based on the
6262
** current state and lookahead token. These tables are used to implement
6363
** functions that take a state number and lookahead value and return an
64-
** action integer.
64+
** action integer.
6565
**
6666
** Suppose the action integer is N. Then the action is determined as
6767
** follows
@@ -86,7 +86,7 @@
8686
** If the index value yy_shift_ofst[S]+X is out of range or if the value
8787
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
8888
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
89-
** and that yy_default[S] should be used instead.
89+
** and that yy_default[S] should be used instead.
9090
**
9191
** The formula above is for computing the action when the lookahead is
9292
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
@@ -110,7 +110,7 @@
110110

111111
/* The next table maps tokens into fallback tokens. If a construct
112112
** like the following:
113-
**
113+
**
114114
** %fallback ID X Y Z.
115115
**
116116
** appears in the grammer, then ID becomes a fallback token for X, Y,
@@ -162,10 +162,10 @@ static char *yyTracePrompt = 0;
162162
#endif /* NDEBUG */
163163

164164
#ifndef NDEBUG
165-
/*
165+
/*
166166
** Turn parser tracing on by giving a stream to which to write the trace
167167
** and a prompt to preface each trace message. Tracing is turned off
168-
** by making either argument NULL
168+
** by making either argument NULL
169169
**
170170
** Inputs:
171171
** <ul>
@@ -190,7 +190,7 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
190190
#ifndef NDEBUG
191191
/* For tracing shifts, the names of all terminals and nonterminals
192192
** are required. The following table supplies these names */
193-
static const char *yyTokenName[] = {
193+
static const char *yyTokenName[] = {
194194
%%
195195
};
196196
#endif /* NDEBUG */
@@ -219,7 +219,7 @@ const char *ParseTokenName(int tokenType){
219219
#endif
220220
}
221221

222-
/*
222+
/*
223223
** This function allocates a new parser.
224224
** The only argument is a pointer to a function which works like
225225
** malloc.
@@ -250,7 +250,7 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
250250
/* Here is inserted the actions which take place when a
251251
** terminal or non-terminal is destroyed. This can happen
252252
** when the symbol is popped from the stack during a
253-
** reduce or during error processing or when a parser is
253+
** reduce or during error processing or when a parser is
254254
** being destroyed before it is finished parsing.
255255
**
256256
** Note: during a reduce, the only symbols destroyed are those
@@ -288,7 +288,7 @@ static int yy_pop_parser_stack(yyParser *pParser){
288288
return yymajor;
289289
}
290290

291-
/*
291+
/*
292292
** Deallocate and destroy a parser. Destructors are all called for
293293
** all stack elements before shutting the parser down.
294294
**
@@ -324,7 +324,7 @@ static int yy_find_shift_action(
324324
){
325325
int i;
326326
int stateno = pParser->yystack[pParser->yyidx].stateno;
327-
327+
328328
/* if( pParser->yyidx<0 ) return YY_NO_ACTION; */
329329
i = yy_shift_ofst[stateno];
330330
if( i==YY_SHIFT_USE_DFLT ){
@@ -368,7 +368,7 @@ static int yy_find_reduce_action(
368368
){
369369
int i;
370370
int stateno = pParser->yystack[pParser->yyidx].stateno;
371-
371+
372372
i = yy_reduce_ofst[stateno];
373373
if( i==YY_REDUCE_USE_DFLT ){
374374
return yy_default[stateno];
@@ -454,7 +454,7 @@ static void yy_reduce(
454454
ParseARG_FETCH;
455455
yymsp = &yypParser->yystack[yypParser->yyidx];
456456
#ifndef NDEBUG
457-
if( yyTraceFILE && yyruleno>=0
457+
if( yyTraceFILE && yyruleno>=0
458458
&& yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
459459
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
460460
yyRuleName[yyruleno]);
@@ -607,7 +607,7 @@ void Parse(
607607
#ifdef YYERRORSYMBOL
608608
/* A syntax error has occurred.
609609
** The response to an error depends upon whether or not the
610-
** grammar defines an error token "ERROR".
610+
** grammar defines an error token "ERROR".
611611
**
612612
** This is what we do if the grammar does define ERROR:
613613
**

zephir_parser.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ PHP_FUNCTION(zephir_parse_file)
3838
char *filepath = NULL;
3939
#if PHP_VERSION_ID >= 70000
4040
zend_array *arr = NULL;
41-
zval ret;
42-
zval error, *error_ptr = &error;
43-
zval **error_msg = &error_ptr;
44-
ZVAL_UNDEF(error_ptr);
41+
zval ret;
42+
zval error, *error_ptr = &error;
43+
zval **error_msg = &error_ptr;
44+
ZVAL_UNDEF(error_ptr);
4545
#else
4646
zval *ret = NULL;
4747
zval **error_msg = NULL;
@@ -60,9 +60,9 @@ PHP_FUNCTION(zephir_parse_file)
6060

6161
#if PHP_VERSION_ID >= 70000
6262
if (Z_TYPE_P(error_ptr) != IS_UNDEF) {
63-
RETURN_ZVAL(error_ptr, 1, 1);
64-
}
65-
RETURN_ZVAL(&ret, 1, 1);
63+
RETURN_ZVAL(error_ptr, 1, 1);
64+
}
65+
RETURN_ZVAL(&ret, 1, 1);
6666
#else
6767
RETVAL_ZVAL(ret, 1, 0);
6868
#endif

0 commit comments

Comments
 (0)