php-parser/node/scalar/magic_constant.go
2017-12-28 01:23:32 +02:00

31 lines
464 B
Go

package scalar
import (
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
)
func (n MagicConstant) Name() string {
return "MagicConstant"
}
type MagicConstant struct {
name string
token token.Token
}
func NewMagicConstant(token token.Token) node.Node {
return MagicConstant{
"MagicConstant",
token,
}
}
func (n MagicConstant) Walk(v node.Visitor) {
if v.Visit(n) == false {
return
}
v.Scalar("token", n.token.Value)
}