#33 comment package has renamed to meta and parser now saves whitespaces

This commit is contained in:
z7zmey 2018-06-30 00:51:11 +03:00
parent 36d0cf4823
commit e90df8ef5f
205 changed files with 16485 additions and 16302 deletions

View File

@ -53,10 +53,10 @@ php-parser [flags] <path> ...
| flag | type | description | | flag | type | description |
|-------|------|----------------------------------------------| |-------|------|----------------------------------------------|
| -d |string| dump format: [custom, go, json, pretty-json] | | -d |string| dump format: [custom, go, json, pretty-json] |
| -prof |string| start profiler: [cpu, mem] |
| -p | bool | show positions | | -p | bool | show positions |
| -c | bool | show comments |
| -r | bool | resolve names | | -r | bool | resolve names |
| -prof |string| start profiler: [cpu, mem] |
| -meta | bool | show meta info |
| -php5 | bool | parse as PHP5 | | -php5 | bool | parse as PHP5 |
Dump AST to stdout. Dump AST to stdout.

View File

@ -1,31 +0,0 @@
package comment_test
import (
"testing"
"github.com/z7zmey/php-parser/comment"
)
func TestCommentPrint(t *testing.T) {
expected := "/** hello world */"
comment := comment.NewComment(expected, nil)
actual := comment.String()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentSetTokenName(t *testing.T) {
expected := comment.ArrayToken
c := comment.NewComment("/** hello world */", nil)
c.SetTokenName(expected)
actual := c.TokenName
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}

16
main.go
View File

@ -21,12 +21,12 @@ var wg sync.WaitGroup
var usePhp5 *bool var usePhp5 *bool
var dumpType string var dumpType string
var profiler string var profiler string
var showComments *bool var withMeta *bool
var showResolvedNs *bool var showResolvedNs *bool
func main() { func main() {
usePhp5 = flag.Bool("php5", false, "parse as PHP5") usePhp5 = flag.Bool("php5", false, "parse as PHP5")
showComments = flag.Bool("c", false, "show comments") withMeta = flag.Bool("meta", false, "show meta")
showResolvedNs = flag.Bool("r", false, "resolve names") showResolvedNs = flag.Bool("r", false, "resolve names")
flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]")
flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]")
@ -107,6 +107,10 @@ func parserWorker(pathCh <-chan string, result chan<- parser.Parser) {
parserWorker = php7.NewParser(src, path) parserWorker = php7.NewParser(src, path)
} }
if *withMeta {
parserWorker.WithMeta()
}
parserWorker.Parse() parserWorker.Parse()
src.Close() src.Close()
@ -138,31 +142,23 @@ func printer(result <-chan parser.Parser) {
parserWorker.GetRootNode().Walk(nsResolver) parserWorker.GetRootNode().Walk(nsResolver)
} }
var comments parser.Comments
if *showComments {
comments = parserWorker.GetComments()
}
switch dumpType { switch dumpType {
case "custom": case "custom":
dumper := &visitor.Dumper{ dumper := &visitor.Dumper{
Writer: os.Stdout, Writer: os.Stdout,
Indent: "| ", Indent: "| ",
Comments: comments,
NsResolver: nsResolver, NsResolver: nsResolver,
} }
parserWorker.GetRootNode().Walk(dumper) parserWorker.GetRootNode().Walk(dumper)
case "json": case "json":
dumper := &visitor.JsonDumper{ dumper := &visitor.JsonDumper{
Writer: os.Stdout, Writer: os.Stdout,
Comments: comments,
NsResolver: nsResolver, NsResolver: nsResolver,
} }
parserWorker.GetRootNode().Walk(dumper) parserWorker.GetRootNode().Walk(dumper)
case "pretty_json": case "pretty_json":
dumper := &visitor.PrettyJsonDumper{ dumper := &visitor.PrettyJsonDumper{
Writer: os.Stdout, Writer: os.Stdout,
Comments: comments,
NsResolver: nsResolver, NsResolver: nsResolver,
} }
parserWorker.GetRootNode().Walk(dumper) parserWorker.GetRootNode().Walk(dumper)

View File

@ -1,4 +1,4 @@
package comment package meta
import ( import (
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
@ -25,6 +25,15 @@ func (c *Comment) SetTokenName(tokenName TokenName) {
c.TokenName = tokenName c.TokenName = tokenName
} }
// GetTokenName returns token name
func (c *Comment) GetTokenName() TokenName {
return c.TokenName
}
func (c *Comment) String() string { func (c *Comment) String() string {
return c.Value return c.Value
} }
func (c *Comment) GetPosition() *position.Position {
return c.Position
}

44
meta/comment_test.go Normal file
View File

@ -0,0 +1,44 @@
package meta_test
import (
"testing"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/meta"
)
func TestCommentPrint(t *testing.T) {
expected := "/** hello world */"
comment := meta.NewComment(expected, nil)
actual := comment.String()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentSetGetTokenName(t *testing.T) {
expected := meta.ArrayToken
c := meta.NewComment("/** hello world */", nil)
c.SetTokenName(expected)
actual := c.GetTokenName()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestCommentGetPosition(t *testing.T) {
expected := position.NewPosition(1, 1, 1, 1)
c := meta.NewComment("/** hello world */", expected)
actual := c.GetPosition()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}

12
meta/meta.go Normal file
View File

@ -0,0 +1,12 @@
package meta
import (
"github.com/z7zmey/php-parser/position"
)
type Meta interface {
String() string
SetTokenName(tn TokenName)
GetTokenName() TokenName
GetPosition() *position.Position
}

View File

@ -1,4 +1,4 @@
package comment package meta
// TokenName is used to specify a comment position // TokenName is used to specify a comment position
type TokenName int type TokenName int

37
meta/white_space.go Normal file
View File

@ -0,0 +1,37 @@
package meta
import (
"github.com/z7zmey/php-parser/position"
)
type WhiteSpace struct {
Value string
Position *position.Position
TokenName TokenName
}
func NewWhiteSpace(value string, pos *position.Position) *WhiteSpace {
return &WhiteSpace{
Value: value,
Position: pos,
TokenName: UnknownToken,
}
}
// SetTokenName sets token name
func (c *WhiteSpace) SetTokenName(tokenName TokenName) {
c.TokenName = tokenName
}
// GetTokenName returns token name
func (c *WhiteSpace) GetTokenName() TokenName {
return c.TokenName
}
func (el *WhiteSpace) String() string {
return el.Value
}
func (el *WhiteSpace) GetPosition() *position.Position {
return el.Position
}

44
meta/white_space_test.go Normal file
View File

@ -0,0 +1,44 @@
package meta_test
import (
"testing"
"github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/meta"
)
func TestWhiteSpacePrint(t *testing.T) {
expected := "\n "
w := meta.NewWhiteSpace(expected, nil)
actual := w.String()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestWhiteSpaceSetGetTokenName(t *testing.T) {
expected := meta.ArrayToken
w := meta.NewWhiteSpace("\n ", nil)
w.SetTokenName(expected)
actual := w.GetTokenName()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}
func TestWhiteSpaceGetPosition(t *testing.T) {
expected := position.NewPosition(1, 1, 1, 1)
q := meta.NewWhiteSpace("\n ", expected)
actual := q.GetPosition()
if expected != actual {
t.Errorf("expected and actual are not equal\n")
}
}

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Assign node // Assign node
type Assign struct { type Assign struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Assign) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Assign) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Assign) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Assign) GetComments() []*comment.Comment { func (n *Assign) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Reference node // Reference node
type Reference struct { type Reference struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Reference) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Reference) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Reference) GetComments() []*comment.Comment { func (n *Reference) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseAnd node // BitwiseAnd node
type BitwiseAnd struct { type BitwiseAnd struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseAnd) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseAnd) GetComments() []*comment.Comment { func (n *BitwiseAnd) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseOr node // BitwiseOr node
type BitwiseOr struct { type BitwiseOr struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseOr) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseOr) GetComments() []*comment.Comment { func (n *BitwiseOr) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseXor node // BitwiseXor node
type BitwiseXor struct { type BitwiseXor struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseXor) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseXor) GetComments() []*comment.Comment { func (n *BitwiseXor) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Concat node // Concat node
type Concat struct { type Concat struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Concat) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Concat) GetComments() []*comment.Comment { func (n *Concat) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Div node // Div node
type Div struct { type Div struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Div) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Div) GetComments() []*comment.Comment { func (n *Div) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Minus node // Minus node
type Minus struct { type Minus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Minus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Minus) GetComments() []*comment.Comment { func (n *Minus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Mod node // Mod node
type Mod struct { type Mod struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Mod) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Mod) GetComments() []*comment.Comment { func (n *Mod) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Mul node // Mul node
type Mul struct { type Mul struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Mul) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Mul) GetComments() []*comment.Comment { func (n *Mul) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Plus node // Plus node
type Plus struct { type Plus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Plus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Plus) GetComments() []*comment.Comment { func (n *Plus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Pow node // Pow node
type Pow struct { type Pow struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Pow) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Pow) GetComments() []*comment.Comment { func (n *Pow) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShiftLeft node // ShiftLeft node
type ShiftLeft struct { type ShiftLeft struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShiftLeft) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShiftLeft) GetComments() []*comment.Comment { func (n *ShiftLeft) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package assign package assign
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShiftRight node // ShiftRight node
type ShiftRight struct { type ShiftRight struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Expression node.Node Expression node.Node
@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShiftRight) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShiftRight) GetComments() []*comment.Comment { func (n *ShiftRight) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseAnd node // BitwiseAnd node
type BitwiseAnd struct { type BitwiseAnd struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseAnd) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseAnd) GetComments() []*comment.Comment { func (n *BitwiseAnd) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseOr node // BitwiseOr node
type BitwiseOr struct { type BitwiseOr struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseOr) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseOr) GetComments() []*comment.Comment { func (n *BitwiseOr) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseXor node // BitwiseXor node
type BitwiseXor struct { type BitwiseXor struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseXor) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseXor) GetComments() []*comment.Comment { func (n *BitwiseXor) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BooleanAnd node // BooleanAnd node
type BooleanAnd struct { type BooleanAnd struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *BooleanAnd) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BooleanAnd) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BooleanAnd) GetComments() []*comment.Comment { func (n *BooleanAnd) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BooleanOr node // BooleanOr node
type BooleanOr struct { type BooleanOr struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *BooleanOr) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BooleanOr) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BooleanOr) GetComments() []*comment.Comment { func (n *BooleanOr) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Coalesce node // Coalesce node
type Coalesce struct { type Coalesce struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Coalesce) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Coalesce) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Coalesce) GetComments() []*comment.Comment { func (n *Coalesce) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Concat node // Concat node
type Concat struct { type Concat struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Concat) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Concat) GetComments() []*comment.Comment { func (n *Concat) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Div node // Div node
type Div struct { type Div struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Div) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Div) GetComments() []*comment.Comment { func (n *Div) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Equal node // Equal node
type Equal struct { type Equal struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Equal) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Equal) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Equal) GetComments() []*comment.Comment { func (n *Equal) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Greater node // Greater node
type Greater struct { type Greater struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Greater) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Greater) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Greater) GetComments() []*comment.Comment { func (n *Greater) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// GreaterOrEqual node // GreaterOrEqual node
type GreaterOrEqual struct { type GreaterOrEqual struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *GreaterOrEqual) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *GreaterOrEqual) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *GreaterOrEqual) GetComments() []*comment.Comment { func (n *GreaterOrEqual) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Identical node // Identical node
type Identical struct { type Identical struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Identical) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Identical) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Identical) GetComments() []*comment.Comment { func (n *Identical) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// LogicalAnd node // LogicalAnd node
type LogicalAnd struct { type LogicalAnd struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *LogicalAnd) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *LogicalAnd) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *LogicalAnd) GetComments() []*comment.Comment { func (n *LogicalAnd) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// LogicalOr node // LogicalOr node
type LogicalOr struct { type LogicalOr struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *LogicalOr) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *LogicalOr) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *LogicalOr) GetComments() []*comment.Comment { func (n *LogicalOr) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// LogicalXor node // LogicalXor node
type LogicalXor struct { type LogicalXor struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *LogicalXor) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *LogicalXor) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *LogicalXor) GetComments() []*comment.Comment { func (n *LogicalXor) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Minus node // Minus node
type Minus struct { type Minus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Minus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Minus) GetComments() []*comment.Comment { func (n *Minus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Mod node // Mod node
type Mod struct { type Mod struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Mod) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Mod) GetComments() []*comment.Comment { func (n *Mod) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Mul node // Mul node
type Mul struct { type Mul struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Mul) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Mul) GetComments() []*comment.Comment { func (n *Mul) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// NotEqual node // NotEqual node
type NotEqual struct { type NotEqual struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *NotEqual) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *NotEqual) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *NotEqual) GetComments() []*comment.Comment { func (n *NotEqual) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// NotIdentical node // NotIdentical node
type NotIdentical struct { type NotIdentical struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *NotIdentical) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *NotIdentical) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *NotIdentical) GetComments() []*comment.Comment { func (n *NotIdentical) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Plus node // Plus node
type Plus struct { type Plus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Plus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Plus) GetComments() []*comment.Comment { func (n *Plus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Pow node // Pow node
type Pow struct { type Pow struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Pow) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Pow) GetComments() []*comment.Comment { func (n *Pow) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShiftLeft node // ShiftLeft node
type ShiftLeft struct { type ShiftLeft struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShiftLeft) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShiftLeft) GetComments() []*comment.Comment { func (n *ShiftLeft) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShiftRight node // ShiftRight node
type ShiftRight struct { type ShiftRight struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShiftRight) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShiftRight) GetComments() []*comment.Comment { func (n *ShiftRight) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Smaller node // Smaller node
type Smaller struct { type Smaller struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Smaller) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Smaller) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Smaller) GetComments() []*comment.Comment { func (n *Smaller) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// SmallerOrEqual node // SmallerOrEqual node
type SmallerOrEqual struct { type SmallerOrEqual struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *SmallerOrEqual) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *SmallerOrEqual) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *SmallerOrEqual) GetComments() []*comment.Comment { func (n *SmallerOrEqual) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package binary package binary
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Spaceship node // Spaceship node
type Spaceship struct { type Spaceship struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Left node.Node Left node.Node
Right node.Node Right node.Node
@ -33,15 +33,12 @@ func (n *Spaceship) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Spaceship) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Spaceship) GetComments() []*comment.Comment { func (n *Spaceship) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Array node // Array node
type Array struct { type Array struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Array) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Array) GetComments() []*comment.Comment { func (n *Array) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Bool node // Bool node
type Bool struct { type Bool struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Bool) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Bool) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Bool) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Bool) GetComments() []*comment.Comment { func (n *Bool) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Double node // Double node
type Double struct { type Double struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Double) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Double) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Double) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Double) GetComments() []*comment.Comment { func (n *Double) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Int node // Int node
type Int struct { type Int struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Int) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Int) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Int) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Int) GetComments() []*comment.Comment { func (n *Int) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Object node // Object node
type Object struct { type Object struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Object) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Object) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Object) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Object) GetComments() []*comment.Comment { func (n *Object) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// String node // String node
type String struct { type String struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *String) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *String) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *String) GetComments() []*comment.Comment { func (n *String) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package cast package cast
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Unset node // Unset node
type Unset struct { type Unset struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Unset) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Unset) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Unset) GetComments() []*comment.Comment { func (n *Unset) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Array node // Array node
type Array struct { type Array struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Items []node.Node Items []node.Node
} }
@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Array) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Array) GetComments() []*comment.Comment { func (n *Array) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ArrayDimFetch node // ArrayDimFetch node
type ArrayDimFetch struct { type ArrayDimFetch struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Dim node.Node Dim node.Node
@ -33,15 +33,12 @@ func (n *ArrayDimFetch) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ArrayDimFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ArrayDimFetch) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ArrayDimFetch) GetComments() []*comment.Comment { func (n *ArrayDimFetch) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ArrayItem node // ArrayItem node
type ArrayItem struct { type ArrayItem struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Key node.Node Key node.Node
Val node.Node Val node.Node
@ -33,15 +33,12 @@ func (n *ArrayItem) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ArrayItem) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ArrayItem) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ArrayItem) GetComments() []*comment.Comment { func (n *ArrayItem) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BitwiseNot node // BitwiseNot node
type BitwiseNot struct { type BitwiseNot struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *BitwiseNot) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BitwiseNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BitwiseNot) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BitwiseNot) GetComments() []*comment.Comment { func (n *BitwiseNot) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// BooleanNot node // BooleanNot node
type BooleanNot struct { type BooleanNot struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *BooleanNot) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *BooleanNot) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *BooleanNot) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *BooleanNot) GetComments() []*comment.Comment { func (n *BooleanNot) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ClassConstFetch node // ClassConstFetch node
type ClassConstFetch struct { type ClassConstFetch struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Class node.Node Class node.Node
ConstantName node.Node ConstantName node.Node
@ -33,15 +33,12 @@ func (n *ClassConstFetch) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ClassConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ClassConstFetch) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ClassConstFetch) GetComments() []*comment.Comment { func (n *ClassConstFetch) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Clone node // Clone node
type Clone struct { type Clone struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Clone) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Clone) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Clone) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Clone) GetComments() []*comment.Comment { func (n *Clone) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Closure node // Closure node
type Closure struct { type Closure struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
ReturnsRef bool ReturnsRef bool
Static bool Static bool
@ -43,15 +43,12 @@ func (n *Closure) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Closure) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Closure) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Closure) GetComments() []*comment.Comment { func (n *Closure) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ClosureUse node // ClosureUse node
type ClosureUse struct { type ClosureUse struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Uses []node.Node Uses []node.Node
} }
@ -31,15 +31,12 @@ func (n *ClosureUse) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ClosureUse) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ClosureUse) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ClosureUse) GetComments() []*comment.Comment { func (n *ClosureUse) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ConstFetch node // ConstFetch node
type ConstFetch struct { type ConstFetch struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Constant node.Node Constant node.Node
} }
@ -31,15 +31,12 @@ func (n *ConstFetch) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ConstFetch) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ConstFetch) GetComments() []*comment.Comment { func (n *ConstFetch) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Die node // Die node
type Die struct { type Die struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Die) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Die) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Die) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Die) GetComments() []*comment.Comment { func (n *Die) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Empty node // Empty node
type Empty struct { type Empty struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Empty) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Empty) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Empty) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Empty) GetComments() []*comment.Comment { func (n *Empty) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ErrorSuppress node // ErrorSuppress node
type ErrorSuppress struct { type ErrorSuppress struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *ErrorSuppress) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ErrorSuppress) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ErrorSuppress) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ErrorSuppress) GetComments() []*comment.Comment { func (n *ErrorSuppress) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Eval node // Eval node
type Eval struct { type Eval struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Eval) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Eval) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Eval) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Eval) GetComments() []*comment.Comment { func (n *Eval) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Exit node // Exit node
type Exit struct { type Exit struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Exit) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Exit) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Exit) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Exit) GetComments() []*comment.Comment { func (n *Exit) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// FunctionCall node // FunctionCall node
type FunctionCall struct { type FunctionCall struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Function node.Node Function node.Node
ArgumentList *node.ArgumentList ArgumentList *node.ArgumentList
@ -33,15 +33,12 @@ func (n *FunctionCall) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *FunctionCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *FunctionCall) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *FunctionCall) GetComments() []*comment.Comment { func (n *FunctionCall) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Include node // Include node
type Include struct { type Include struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Include) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Include) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Include) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Include) GetComments() []*comment.Comment { func (n *Include) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// IncludeOnce node // IncludeOnce node
type IncludeOnce struct { type IncludeOnce struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *IncludeOnce) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *IncludeOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *IncludeOnce) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *IncludeOnce) GetComments() []*comment.Comment { func (n *IncludeOnce) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// InstanceOf node // InstanceOf node
type InstanceOf struct { type InstanceOf struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
Class node.Node Class node.Node
@ -33,15 +33,12 @@ func (n *InstanceOf) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *InstanceOf) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *InstanceOf) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *InstanceOf) GetComments() []*comment.Comment { func (n *InstanceOf) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Isset node // Isset node
type Isset struct { type Isset struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variables []node.Node Variables []node.Node
} }
@ -31,15 +31,12 @@ func (n *Isset) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Isset) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Isset) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Isset) GetComments() []*comment.Comment { func (n *Isset) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// List node // List node
type List struct { type List struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Items []node.Node Items []node.Node
} }
@ -31,15 +31,12 @@ func (n *List) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *List) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *List) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *List) GetComments() []*comment.Comment { func (n *List) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// MethodCall node // MethodCall node
type MethodCall struct { type MethodCall struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Method node.Node Method node.Node
@ -35,15 +35,12 @@ func (n *MethodCall) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *MethodCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *MethodCall) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *MethodCall) GetComments() []*comment.Comment { func (n *MethodCall) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// New node // New node
type New struct { type New struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Class node.Node Class node.Node
ArgumentList *node.ArgumentList ArgumentList *node.ArgumentList
@ -33,15 +33,12 @@ func (n *New) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *New) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *New) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *New) GetComments() []*comment.Comment { func (n *New) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// PostDec node // PostDec node
type PostDec struct { type PostDec struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
} }
@ -31,15 +31,12 @@ func (n *PostDec) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *PostDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *PostDec) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *PostDec) GetComments() []*comment.Comment { func (n *PostDec) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// PostInc node // PostInc node
type PostInc struct { type PostInc struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
} }
@ -31,15 +31,12 @@ func (n *PostInc) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *PostInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *PostInc) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *PostInc) GetComments() []*comment.Comment { func (n *PostInc) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// PreDec node // PreDec node
type PreDec struct { type PreDec struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
} }
@ -31,15 +31,12 @@ func (n *PreDec) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *PreDec) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *PreDec) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *PreDec) GetComments() []*comment.Comment { func (n *PreDec) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// PreInc node // PreInc node
type PreInc struct { type PreInc struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
} }
@ -31,15 +31,12 @@ func (n *PreInc) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *PreInc) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *PreInc) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *PreInc) GetComments() []*comment.Comment { func (n *PreInc) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Print node // Print node
type Print struct { type Print struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Print) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Print) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Print) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Print) GetComments() []*comment.Comment { func (n *Print) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// PropertyFetch node // PropertyFetch node
type PropertyFetch struct { type PropertyFetch struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
Property node.Node Property node.Node
@ -33,15 +33,12 @@ func (n *PropertyFetch) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *PropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *PropertyFetch) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *PropertyFetch) GetComments() []*comment.Comment { func (n *PropertyFetch) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Reference node // Reference node
type Reference struct { type Reference struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Variable node.Node Variable node.Node
} }
@ -31,15 +31,12 @@ func (n *Reference) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Reference) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Reference) GetComments() []*comment.Comment { func (n *Reference) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Require node // Require node
type Require struct { type Require struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *Require) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Require) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Require) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Require) GetComments() []*comment.Comment { func (n *Require) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// RequireOnce node // RequireOnce node
type RequireOnce struct { type RequireOnce struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *RequireOnce) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *RequireOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *RequireOnce) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *RequireOnce) GetComments() []*comment.Comment { func (n *RequireOnce) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShellExec node // ShellExec node
type ShellExec struct { type ShellExec struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Parts []node.Node Parts []node.Node
} }
@ -31,15 +31,12 @@ func (n *ShellExec) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShellExec) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShellExec) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShellExec) GetComments() []*comment.Comment { func (n *ShellExec) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShortArray node // ShortArray node
type ShortArray struct { type ShortArray struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Items []node.Node Items []node.Node
} }
@ -31,15 +31,12 @@ func (n *ShortArray) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShortArray) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShortArray) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShortArray) GetComments() []*comment.Comment { func (n *ShortArray) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// ShortList node // ShortList node
type ShortList struct { type ShortList struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Items []node.Node Items []node.Node
} }
@ -31,15 +31,12 @@ func (n *ShortList) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *ShortList) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *ShortList) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *ShortList) GetComments() []*comment.Comment { func (n *ShortList) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// StaticCall node // StaticCall node
type StaticCall struct { type StaticCall struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Class node.Node Class node.Node
Call node.Node Call node.Node
@ -35,15 +35,12 @@ func (n *StaticCall) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *StaticCall) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *StaticCall) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *StaticCall) GetComments() []*comment.Comment { func (n *StaticCall) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// StaticPropertyFetch node // StaticPropertyFetch node
type StaticPropertyFetch struct { type StaticPropertyFetch struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Class node.Node Class node.Node
Property node.Node Property node.Node
@ -33,15 +33,12 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *StaticPropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *StaticPropertyFetch) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *StaticPropertyFetch) GetComments() []*comment.Comment { func (n *StaticPropertyFetch) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Ternary node // Ternary node
type Ternary struct { type Ternary struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Condition node.Node Condition node.Node
IfTrue node.Node IfTrue node.Node
@ -35,15 +35,12 @@ func (n *Ternary) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Ternary) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Ternary) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Ternary) GetComments() []*comment.Comment { func (n *Ternary) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// UnaryMinus node // UnaryMinus node
type UnaryMinus struct { type UnaryMinus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *UnaryMinus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *UnaryMinus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *UnaryMinus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *UnaryMinus) GetComments() []*comment.Comment { func (n *UnaryMinus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// UnaryPlus node // UnaryPlus node
type UnaryPlus struct { type UnaryPlus struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *UnaryPlus) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *UnaryPlus) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *UnaryPlus) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *UnaryPlus) GetComments() []*comment.Comment { func (n *UnaryPlus) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Variable node // Variable node
type Variable struct { type Variable struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
VarName node.Node VarName node.Node
} }
@ -31,15 +31,12 @@ func (n *Variable) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Variable) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Variable) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Variable) GetComments() []*comment.Comment { func (n *Variable) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// Yield node // Yield node
type Yield struct { type Yield struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Key node.Node Key node.Node
Value node.Node Value node.Node
@ -33,15 +33,12 @@ func (n *Yield) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *Yield) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *Yield) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *Yield) GetComments() []*comment.Comment { func (n *Yield) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

View File

@ -1,7 +1,7 @@
package expr package expr
import ( import (
"github.com/z7zmey/php-parser/comment" "github.com/z7zmey/php-parser/meta"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/position" "github.com/z7zmey/php-parser/position"
"github.com/z7zmey/php-parser/walker" "github.com/z7zmey/php-parser/walker"
@ -9,7 +9,7 @@ import (
// YieldFrom node // YieldFrom node
type YieldFrom struct { type YieldFrom struct {
Comments []*comment.Comment Meta []meta.Meta
Position *position.Position Position *position.Position
Expr node.Node Expr node.Node
} }
@ -31,15 +31,12 @@ func (n *YieldFrom) GetPosition() *position.Position {
return n.Position return n.Position
} }
func (n *YieldFrom) AddComments(cc []*comment.Comment, tn comment.TokenName) { func (n *YieldFrom) AddMeta(m []meta.Meta) {
for _, c := range cc { n.Meta = append(n.Meta, m...)
c.SetTokenName(tn)
}
n.Comments = append(n.Comments, cc...)
} }
func (n *YieldFrom) GetComments() []*comment.Comment { func (n *YieldFrom) GetMeta() []meta.Meta {
return n.Comments return n.Meta
} }
// Attributes returns node attributes as map // Attributes returns node attributes as map

Some files were not shown because too many files have changed in this diff Show More