replace meta.OpenSquareBracket

This commit is contained in:
z7zmey 2018-10-29 12:38:06 +02:00
parent 6dde9ef052
commit 82a06f5b10
6 changed files with 12 additions and 14 deletions

View File

@ -6795,7 +6795,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
@ -7574,7 +7574,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)

View File

@ -4411,7 +4411,7 @@ combined_scalar:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments
$1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
@ -5127,7 +5127,7 @@ static_scalar_value:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments
$1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)

View File

@ -4054,7 +4054,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
@ -5535,7 +5535,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition(yyDollar[1].token, yyDollar[5].node))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta())
yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta())
yyDollar[4].token.Meta.SetTokenName(meta.EqualToken).AppendTo(yyVAL.node.GetMeta())
@ -6881,7 +6881,7 @@ yydefault:
yyVAL.node.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition(yyDollar[1].token, yyDollar[3].token))
// save comments
yyDollar[1].token.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(yyVAL.node.GetMeta())
yyDollar[1].token.Meta.SetTokenName(meta.NodeStart).AppendTo(yyVAL.node.GetMeta())
yyDollar[3].token.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(yyVAL.node.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)

View File

@ -1692,7 +1692,7 @@ foreach_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments
$1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)
@ -3110,7 +3110,7 @@ expr_without_variable:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5))
// save comments
$1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo(shortList.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo(shortList.GetMeta())
$3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo(shortList.GetMeta())
$4.Meta.SetTokenName(meta.EqualToken).AppendTo($$.GetMeta())
@ -4292,7 +4292,7 @@ dereferencable_scalar:
$$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3))
// save comments
$1.Meta.SetTokenName(meta.OpenSquareBracket).AppendTo($$.GetMeta())
$1.Meta.SetTokenName(meta.NodeStart).AppendTo($$.GetMeta())
$3.Meta.SetTokenName(meta.CloseSquareBracket).AppendTo($$.GetMeta())
yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL)

View File

@ -1558,7 +1558,6 @@ func (p *Printer) printExprShortArray(n node.Node) {
nn := n.(*expr.ShortArray)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.OpenSquareBracket)
io.WriteString(p.w, "[")
p.joinPrint(",", nn.Items)
p.printMeta(nn, meta.CloseSquareBracket)
@ -1571,7 +1570,6 @@ func (p *Printer) printExprShortList(n node.Node) {
nn := n.(*expr.ShortList)
p.printMeta(nn, meta.NodeStart)
p.printMeta(nn, meta.OpenSquareBracket)
io.WriteString(p.w, "[")
p.joinPrint(",", nn.Items)
p.printMeta(nn, meta.CloseSquareBracket)

View File

@ -4211,7 +4211,7 @@ func TestPrinterPrintExprShortArray(t *testing.T) {
&meta.Data{
Type: meta.WhiteSpaceType,
Value: " ",
TokenName: meta.OpenSquareBracket,
TokenName: meta.NodeStart,
},
&meta.Data{
Type: meta.WhiteSpaceType,
@ -4278,7 +4278,7 @@ func TestPrinterPrintShortList(t *testing.T) {
&meta.Data{
Type: meta.WhiteSpaceType,
Value: " ",
TokenName: meta.OpenSquareBracket,
TokenName: meta.NodeStart,
},
&meta.Data{
Type: meta.WhiteSpaceType,