diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e4b1646..56f92ea 100644 Binary files a/internal/php5/php5.go and b/internal/php5/php5.go differ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 3af3c85..4876d91 100644 Binary files a/internal/php7/php7.go and b/internal/php7/php7.go differ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 72ec026..0bfff99 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1948,13 +1948,13 @@ type_expr: } | '?' type { - $$ = &ast.Nullable{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.Nullable{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + QuestionTkn: $1, + Expr: $2, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d792bea..eaf4930 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -33,7 +33,8 @@ func (n *Root) Accept(v NodeVisitor) { // Nullable node type Nullable struct { Node - Expr Vertex + QuestionTkn *token.Token + Expr Vertex } func (n *Nullable) Accept(v NodeVisitor) {