[refactoring] update ast structure of "Nullable"
This commit is contained in:
parent
bf3ae74d56
commit
43ace92875
BIN
internal/php5/php5.go
generated
BIN
internal/php5/php5.go
generated
Binary file not shown.
BIN
internal/php7/php7.go
generated
BIN
internal/php7/php7.go
generated
Binary file not shown.
@ -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,7 +33,8 @@ func (n *Root) Accept(v NodeVisitor) {
|
|||||||
// Nullable node
|
// Nullable node
|
||||||
type Nullable struct {
|
type Nullable struct {
|
||||||
Node
|
Node
|
||||||
Expr Vertex
|
QuestionTkn *token.Token
|
||||||
|
Expr Vertex
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Nullable) Accept(v NodeVisitor) {
|
func (n *Nullable) Accept(v NodeVisitor) {
|
||||||
|
Loading…
Reference in New Issue
Block a user