[refactoring] update ast structure of "InlinHtml" node

This commit is contained in:
Vadym Slizov
2020-09-14 16:36:01 +03:00
parent 7678303cb9
commit 8b4d65ac4d
7 changed files with 36 additions and 36 deletions

14
internal/php5/php5.go generated
View File

@@ -3190,13 +3190,13 @@ yydefault:
yyDollar = yyS[yypt-1 : yypt+1]
// line internal/php5/php5.y:1064
{
yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value}
// save position
yyVAL.node.GetNode().Position = position.NewTokenPosition(yyDollar[1].token)
// save comments
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens)
yyVAL.node = &ast.StmtInlineHtml{
Node: ast.Node{
Position: position.NewTokenPosition(yyDollar[1].token),
},
InlineHtmlTkn: yyDollar[1].token,
Value: yyDollar[1].token.Value,
}
}
case 66:
yyDollar = yyS[yypt-2 : yypt+1]

View File

@@ -1062,13 +1062,13 @@ unticked_statement:
}
| T_INLINE_HTML
{
$$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value}
// save position
$$.GetNode().Position = position.NewTokenPosition($1)
// save comments
yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens)
$$ = &ast.StmtInlineHtml{
Node: ast.Node{
Position: position.NewTokenPosition($1),
},
InlineHtmlTkn: $1,
Value: $1.Value,
}
}
| expr ';'
{

14
internal/php7/php7.go generated
View File

@@ -3314,13 +3314,13 @@ yydefault:
yyDollar = yyS[yypt-1 : yypt+1]
// line internal/php7/php7.y:978
{
yyVAL.node = &ast.StmtInlineHtml{ast.Node{}, yyDollar[1].token.Value}
// save position
yyVAL.node.GetNode().Position = position.NewTokenPosition(yyDollar[1].token)
// save comments
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens)
yyVAL.node = &ast.StmtInlineHtml{
Node: ast.Node{
Position: position.NewTokenPosition(yyDollar[1].token),
},
InlineHtmlTkn: yyDollar[1].token,
Value: yyDollar[1].token.Value,
}
}
case 146:
yyDollar = yyS[yypt-2 : yypt+1]

View File

@@ -976,13 +976,13 @@ statement:
}
| T_INLINE_HTML
{
$$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value}
// save position
$$.GetNode().Position = position.NewTokenPosition($1)
// save comments
yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens)
$$ = &ast.StmtInlineHtml{
Node: ast.Node{
Position: position.NewTokenPosition($1),
},
InlineHtmlTkn: $1,
Value: $1.Value,
}
}
| expr ';'
{