stmt visitor tests

This commit is contained in:
z7zmey
2018-02-06 19:11:47 +02:00
parent b06fd9887d
commit d7d17326b6
12 changed files with 523 additions and 36 deletions

View File

@@ -2692,7 +2692,7 @@ yydefault:
yyDollar = yyS[yypt-3 : yypt+1]
//line php5/php5.y:605
{
yyVAL.node = stmt.NewWhile(yyDollar[1].token, yyDollar[2].node, yyDollar[3].node)
yyVAL.node = stmt.NewWhile(yyDollar[2].node, yyDollar[3].node)
positions.AddPosition(yyVAL.node, positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[3].node))
comments.AddComments(yyVAL.node, yyDollar[1].token.Comments())
}
@@ -2716,7 +2716,7 @@ yydefault:
yyDollar = yyS[yypt-3 : yypt+1]
//line php5/php5.y:623
{
yyVAL.node = stmt.NewSwitch(yyDollar[1].token, yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes)
yyVAL.node = stmt.NewSwitch(yyDollar[2].node, yyDollar[3].nodesWithEndToken.nodes)
positions.AddPosition(yyVAL.node, positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].nodesWithEndToken.endToken))
comments.AddComments(yyVAL.node, yyDollar[1].token.Comments())
}

View File

@@ -603,7 +603,7 @@ unticked_statement:
}
| T_WHILE parenthesis_expr while_statement
{
$$ = stmt.NewWhile($1, $2, $3)
$$ = stmt.NewWhile($2, $3)
positions.AddPosition($$, positionBuilder.NewTokenNodePosition($1, $3))
comments.AddComments($$, $1.Comments())
}
@@ -621,7 +621,7 @@ unticked_statement:
}
| T_SWITCH parenthesis_expr switch_case_list
{
$$ = stmt.NewSwitch($1, $2, $3.nodes)
$$ = stmt.NewSwitch($2, $3.nodes)
positions.AddPosition($$, positionBuilder.NewTokensPosition($1, $3.endToken))
comments.AddComments($$, $1.Comments())
}