[refactoring] update ast structure of "Encapsed", "EncapsedStringPart" and "Heredoc" nodes
This commit is contained in:
@@ -558,7 +558,7 @@ func (p *PrettyPrinter) printScalarEncapsed(n ast.Vertex) {
|
||||
func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) {
|
||||
nn := n.(*ast.ScalarHeredoc)
|
||||
|
||||
io.WriteString(p.w, string(nn.Label))
|
||||
io.WriteString(p.w, string(nn.OpenHeredocTkn.Value))
|
||||
|
||||
for _, part := range nn.Parts {
|
||||
switch part.(type) {
|
||||
@@ -571,7 +571,7 @@ func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) {
|
||||
}
|
||||
}
|
||||
|
||||
io.WriteString(p.w, strings.Trim(string(nn.Label), "<\"'\n"))
|
||||
io.WriteString(p.w, strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n"))
|
||||
}
|
||||
|
||||
func (p *PrettyPrinter) printScalarMagicConstant(n ast.Vertex) {
|
||||
|
||||
@@ -687,7 +687,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) {
|
||||
p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart)
|
||||
p.bufStart = ""
|
||||
|
||||
p.write(nn.Label)
|
||||
p.write(nn.OpenHeredocTkn.Value)
|
||||
|
||||
for _, part := range nn.Parts {
|
||||
switch part.(type) {
|
||||
@@ -710,7 +710,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) {
|
||||
}
|
||||
}
|
||||
|
||||
p.write([]byte(strings.Trim(string(nn.Label), "<\"'\n")))
|
||||
p.write([]byte(strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n")))
|
||||
|
||||
p.printFreeFloating(nn, token.End)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user