remove meta.QuestionMarkToken from node.Nullable
This commit is contained in:
parent
d232d3ae6b
commit
aa9fb90138
@ -4581,7 +4581,7 @@ yydefault:
|
||||
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[2].node))
|
||||
|
||||
// save comments
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo(yyVAL.node.GetMeta())
|
||||
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -2197,7 +2197,7 @@ type_expr:
|
||||
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2))
|
||||
|
||||
// save comments
|
||||
$1.Meta.SetTokenName(meta.QuestionMarkToken).AppendTo($$.GetMeta())
|
||||
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
|
||||
|
||||
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
|
||||
}
|
||||
|
@ -465,8 +465,6 @@ func (p *Printer) printNodeNullable(n node.Node) {
|
||||
nn := n.(*node.Nullable)
|
||||
p.printMeta(nn, meta.NodeStart)
|
||||
|
||||
p.printMeta(nn, meta.QuestionMarkToken)
|
||||
|
||||
io.WriteString(p.w, "?")
|
||||
p.Print(nn.Expr)
|
||||
|
||||
|
@ -217,7 +217,7 @@ func TestPrinterPrintNullable(t *testing.T) {
|
||||
&meta.Data{
|
||||
Type: meta.WhiteSpaceType,
|
||||
Value: " ",
|
||||
TokenName: meta.QuestionMarkToken,
|
||||
TokenName: meta.NodeStart,
|
||||
},
|
||||
},
|
||||
Expr: &node.Parameter{
|
||||
|
Loading…
Reference in New Issue
Block a user