rename const_list and class_const_list

This commit is contained in:
vadim
2017-12-27 16:44:19 +02:00
parent 06a15be7a2
commit b9d686eca1
4 changed files with 14 additions and 14 deletions

View File

@@ -8,23 +8,23 @@ import (
"github.com/z7zmey/php-parser/token"
)
type ClassConst struct {
type ClassConstList struct {
node.SimpleNode
token token.Token
modifiers []node.Node
consts []node.Node
}
func NewClassConst(token token.Token, modifiers []node.Node, consts []node.Node) node.Node {
return ClassConst{
node.SimpleNode{Name: "ClassConst", Attributes: make(map[string]string)},
func NewClassConstList(token token.Token, modifiers []node.Node, consts []node.Node) node.Node {
return ClassConstList{
node.SimpleNode{Name: "ClassConstList", Attributes: make(map[string]string)},
token,
modifiers,
consts,
}
}
func (n ClassConst) Print(out io.Writer, indent string) {
func (n ClassConstList) 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)
if n.modifiers != nil {

View File

@@ -8,21 +8,21 @@ import (
"github.com/z7zmey/php-parser/token"
)
type StmtConst struct {
type ConstList struct {
node.SimpleNode
token token.Token
consts []node.Node
}
func NewStmtConst(token token.Token, consts []node.Node) node.Node {
return StmtConst{
node.SimpleNode{Name: "StmtConst", Attributes: make(map[string]string)},
func NewConstList(token token.Token, consts []node.Node) node.Node {
return ConstList{
node.SimpleNode{Name: "ConstList", Attributes: make(map[string]string)},
token,
consts,
}
}
func (n StmtConst) Print(out io.Writer, indent string) {
func (n ConstList) 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)
if n.consts != nil {