php-parser/node/node_scalar_encapsed_string_part.go

28 lines
603 B
Go
Raw Normal View History

2017-12-03 21:29:17 +00:00
package node
import (
"fmt"
"github.com/z7zmey/php-parser/token"
"io"
)
type NodeScalarEncapsedStringPart struct {
2017-12-04 21:24:12 +00:00
*SimpleNode
2017-12-03 21:29:17 +00:00
token token.Token
}
func NewNodeScalarEncapsedStringPart(t token.Token) Node {
return NodeScalarEncapsedStringPart{
2017-12-04 21:24:12 +00:00
&SimpleNode{Name: "NodeScalarEncapsedStringPart", Attributes: make(map[string]string)},
2017-12-03 21:29:17 +00:00
t,
}
}
func (n NodeScalarEncapsedStringPart) Print(out io.Writer, indent string) {
2017-12-04 21:24:12 +00:00
fmt.Fprintf(out, "\n%v%v [%d %d] %q", indent, n.Name, n.token.StartLine, n.token.EndLine, n.token.Value)
for _, nn := range n.Children {
2017-12-03 21:29:17 +00:00
nn.Print(out, indent+" ")
}
}