diff --git a/support/xhpast/ast.hpp b/support/xhpast/ast.hpp --- a/support/xhpast/ast.hpp +++ b/support/xhpast/ast.hpp @@ -63,7 +63,7 @@ std::deque > tag_stack; }; -#define YYSTYPE xhpast::Node * +#define YYSTYPE xhpast::Node* #define YY_HEADER_EXPORT_START_CONDITIONS #define YY_EXTRA_TYPE yy_extra_type* @@ -72,7 +72,7 @@ #include "scanner.lex.hpp" #endif -int xhpparse(void*, YYSTYPE *); +int xhpparse(void*, YYSTYPE*); void xhp_new_push_state(int s, struct yyguts_t* yyg); void xhp_new_pop_state(struct yyguts_t* yyg); void xhp_set_state(int s, struct yyguts_t* yyg); diff --git a/support/xhpast/astnode.hpp b/support/xhpast/astnode.hpp --- a/support/xhpast/astnode.hpp +++ b/support/xhpast/astnode.hpp @@ -7,10 +7,9 @@ namespace xhpast { class Token; - typedef std::list token_list_t; + typedef std::list token_list_t; class Token { - public: unsigned int type; std::string value; @@ -21,12 +20,11 @@ type(type), value(value), lineno(0), - n(n) { - } + n(n) {} }; class Node; - typedef std::list node_list_t; + typedef std::list node_list_t; class Node { public: @@ -37,23 +35,25 @@ node_list_t children; + Node() : + type(0), + l_tok(-1), + r_tok(-1) {} - Node() : type(0), l_tok(-1), r_tok(-1) {}; - - Node(unsigned int type) : type(type), l_tok(-1), r_tok(-1) {}; + Node(unsigned int type) : + type(type), + l_tok(-1), + r_tok(-1) {} Node(unsigned int type, int end_tok) : - type(type) { - this->l_tok = end_tok; - this->r_tok = end_tok; - } + type(type), + l_tok(end_tok), + r_tok(end_tok) {} Node(unsigned int type, int l_tok, int r_tok) : type(type), l_tok(l_tok), - r_tok(r_tok) { - - } + r_tok(r_tok) {} Node *appendChild(Node *node) { this->children.push_back(node); @@ -89,7 +89,7 @@ "Trying to expandRange() a null node to one of type %d\n", this->type); exit(1); - }; + } if (n->l_tok != -1 && (n->l_tok < this->l_tok || (this->l_tok == -1))) { this->l_tok = n->l_tok; @@ -101,6 +101,5 @@ return this; } - }; } diff --git a/support/xhpast/parser.y b/support/xhpast/parser.y --- a/support/xhpast/parser.y +++ b/support/xhpast/parser.y @@ -380,7 +380,7 @@ if ($7->type == n_EMPTY) { // Ignore. } else if ($7->type == n_ELSE) { - xhpast::Node *stype = $7->firstChild()->firstChild(); + xhpast::Node* stype = $7->firstChild()->firstChild(); if (stype && stype->type == n_CONDITION_LIST) { NTYPE(stype->firstChild(), n_ELSEIF); stype->firstChild()->l_tok = $7->l_tok; diff --git a/support/xhpast/parser.yacc.cpp b/support/xhpast/parser.yacc.cpp --- a/support/xhpast/parser.yacc.cpp +++ b/support/xhpast/parser.yacc.cpp @@ -3752,7 +3752,7 @@ if ((yyvsp[0])->type == n_EMPTY) { // Ignore. } else if ((yyvsp[0])->type == n_ELSE) { - xhpast::Node *stype = (yyvsp[0])->firstChild()->firstChild(); + xhpast::Node* stype = (yyvsp[0])->firstChild()->firstChild(); if (stype && stype->type == n_CONDITION_LIST) { NTYPE(stype->firstChild(), n_ELSEIF); stype->firstChild()->l_tok = (yyvsp[0])->l_tok; diff --git a/support/xhpast/scanner.l b/support/xhpast/scanner.l --- a/support/xhpast/scanner.l +++ b/support/xhpast/scanner.l @@ -364,7 +364,9 @@ yytext + yyextra->heredoc_yyleng, yyextra->heredoc_label.size()) == 0) { switch (yytext[yyextra->heredoc_yyleng + yyextra->heredoc_label.size()]) { - case ';': case '\n': case '\r': + case ';': + case '\n': + case '\r': yyless( yyleng - ( yyleng - diff --git a/support/xhpast/scanner.lex.hpp b/support/xhpast/scanner.lex.hpp --- a/support/xhpast/scanner.lex.hpp +++ b/support/xhpast/scanner.lex.hpp @@ -361,7 +361,7 @@ #undef YY_DECL #endif -#line 399 "scanner.l" +#line 401 "scanner.l" #line 368 "scanner.lex.hpp" diff --git a/support/xhpast/scanner.lex.cpp b/support/xhpast/scanner.lex.cpp --- a/support/xhpast/scanner.lex.cpp +++ b/support/xhpast/scanner.lex.cpp @@ -4648,7 +4648,9 @@ yytext + yyextra->heredoc_yyleng, yyextra->heredoc_label.size()) == 0) { switch (yytext[yyextra->heredoc_yyleng + yyextra->heredoc_label.size()]) { - case ';': case '\n': case '\r': + case ';': + case '\n': + case '\r': yyless( yyleng - ( yyleng - @@ -4665,7 +4667,7 @@ YY_BREAK case 140: YY_RULE_SETUP -#line 381 "scanner.l" +#line 383 "scanner.l" { yyextra->heredoc_yyleng = yyleng; yymore(); @@ -4674,7 +4676,7 @@ case 141: /* rule 141 can match eol */ YY_RULE_SETUP -#line 385 "scanner.l" +#line 387 "scanner.l" { ++yyextra->lineno; yyextra->heredoc_yyleng = yyleng; @@ -4686,7 +4688,7 @@ case 142: /* rule 142 can match eol */ YY_RULE_SETUP -#line 393 "scanner.l" +#line 395 "scanner.l" { tok(yytext[0]); // fix unused function warnings @@ -4696,10 +4698,10 @@ YY_BREAK case 143: YY_RULE_SETUP -#line 400 "scanner.l" +#line 402 "scanner.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 4703 "scanner.lex.cpp" +#line 4705 "scanner.lex.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PHP): case YY_STATE_EOF(PHP_HEREDOC_START): @@ -5906,7 +5908,7 @@ #define YYTABLES_NAME "yytables" -#line 399 "scanner.l" +#line 401 "scanner.l"