php-parser/node/stmt/label.go
2017-12-27 19:55:58 +02:00

30 lines
467 B
Go

package stmt
import (
"fmt"
"io"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/token"
)
func(n Label) Name() string {
return "Label"
}
type Label struct {
name string
token token.Token
}
func NewLabel(token token.Token) node.Node {
return Label{
"Label",
token,
}
}
func (n Label) 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)
}