[refactoring] update ast structure of "Nullable"
This commit is contained in:
parent
bf3ae74d56
commit
43ace92875
14
internal/php7/php7.go
generated
14
internal/php7/php7.go
generated
@ -4343,13 +4343,13 @@ yydefault:
|
|||||||
yyDollar = yyS[yypt-2 : yypt+1]
|
yyDollar = yyS[yypt-2 : yypt+1]
|
||||||
// line internal/php7/php7.y:1950
|
// line internal/php7/php7.y:1950
|
||||||
{
|
{
|
||||||
yyVAL.node = &ast.Nullable{ast.Node{}, yyDollar[2].node}
|
yyVAL.node = &ast.Nullable{
|
||||||
|
Node: ast.Node{
|
||||||
// save position
|
Position: position.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node),
|
||||||
yyVAL.node.GetNode().Position = position.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node)
|
},
|
||||||
|
QuestionTkn: yyDollar[1].token,
|
||||||
// save comments
|
Expr: yyDollar[2].node,
|
||||||
yylex.(*Parser).setFreeFloating(yyVAL.node, token.Start, yyDollar[1].token.SkippedTokens)
|
}
|
||||||
}
|
}
|
||||||
case 223:
|
case 223:
|
||||||
yyDollar = yyS[yypt-1 : yypt+1]
|
yyDollar = yyS[yypt-1 : yypt+1]
|
||||||
|
@ -1948,13 +1948,13 @@ type_expr:
|
|||||||
}
|
}
|
||||||
| '?' type
|
| '?' type
|
||||||
{
|
{
|
||||||
$$ = &ast.Nullable{ast.Node{}, $2}
|
$$ = &ast.Nullable{
|
||||||
|
Node: ast.Node{
|
||||||
// save position
|
Position: position.NewTokenNodePosition($1, $2),
|
||||||
$$.GetNode().Position = position.NewTokenNodePosition($1, $2)
|
},
|
||||||
|
QuestionTkn: $1,
|
||||||
// save comments
|
Expr: $2,
|
||||||
yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens)
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ func (n *Root) Accept(v NodeVisitor) {
|
|||||||
// Nullable node
|
// Nullable node
|
||||||
type Nullable struct {
|
type Nullable struct {
|
||||||
Node
|
Node
|
||||||
|
QuestionTkn *token.Token
|
||||||
Expr Vertex
|
Expr Vertex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user