php-parser/node/scalar/string.go
2018-01-05 00:12:01 +02:00

41 lines
576 B
Go

package scalar
import (
"github.com/z7zmey/php-parser/node"
)
type String struct {
position *node.Position
Value string
}
func NewString(Value string) node.Node {
return &String{
nil,
Value,
}
}
func (n String) Attributes() map[string]interface{} {
return map[string]interface{}{
"Value": n.Value,
}
}
func (n String) Position() *node.Position {
return n.position
}
func (n String) SetPosition(p *node.Position) node.Node {
n.position = p
return n
}
func (n String) Walk(v node.Visitor) {
if v.EnterNode(n) == false {
return
}
v.LeaveNode(n)
}