modifiers list

This commit is contained in:
vadim
2017-12-22 13:20:34 +02:00
parent d235a58abc
commit ba71b6e7fa
4 changed files with 129 additions and 127 deletions

View File

@@ -34,9 +34,9 @@ func (n ClassMethod) 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 {
fmt.Fprintf(out, "\n%vmotifiers:", indent+" ")
fmt.Fprintf(out, "\n%vmodifiers:", indent+" ")
for _, nn := range n.modifiers {
fmt.Fprintf(out, "\n%v%q", indent+" ", nn)
nn.Print(out, indent+" ")
}
}

View File

@@ -9,11 +9,11 @@ import (
type PropertyList struct {
node.SimpleNode
modifiers node.Node
modifiers []node.Node
properties []node.Node
}
func NewPropertyList(modifiers node.Node, properties []node.Node) node.Node {
func NewPropertyList(modifiers []node.Node, properties []node.Node) node.Node {
return PropertyList{
node.SimpleNode{Name: "PropertyList", Attributes: make(map[string]string)},
modifiers,
@@ -26,7 +26,9 @@ func (n PropertyList) Print(out io.Writer, indent string) {
if n.modifiers != nil {
fmt.Fprintf(out, "\n%vmodifiers:", indent+" ")
n.modifiers.Print(out, indent+" ")
for _, nn := range n.modifiers {
nn.Print(out, indent+" ")
}
}
if n.properties != nil {