php-parser/node/scalar/encapsed_string_part.go
2017-12-05 00:02:24 +02:00

29 lines
605 B
Go

package scalar
import (
"fmt"
"github.com/z7zmey/php-parser/token"
"github.com/z7zmey/php-parser/node"
"io"
)
type EncapsedStringPart struct {
node.SimpleNode
token token.Token
}
func NewEncapsedStringPart(t token.Token) node.Node {
return EncapsedStringPart{
node.SimpleNode{Name: "EncapsedStringPart", Attributes: make(map[string]string)},
t,
}
}
func (n EncapsedStringPart) Print(out io.Writer, indent string) {
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 {
nn.Print(out, indent+" ")
}
}