#33 comment package has renamed to meta and parser now saves whitespaces
This commit is contained in:
parent
36d0cf4823
commit
e90df8ef5f
@ -53,10 +53,10 @@ php-parser [flags] <path> ...
|
||||
| flag | type | description |
|
||||
|-------|------|----------------------------------------------|
|
||||
| -d |string| dump format: [custom, go, json, pretty-json] |
|
||||
| -prof |string| start profiler: [cpu, mem] |
|
||||
| -p | bool | show positions |
|
||||
| -c | bool | show comments |
|
||||
| -r | bool | resolve names |
|
||||
| -prof |string| start profiler: [cpu, mem] |
|
||||
| -meta | bool | show meta info |
|
||||
| -php5 | bool | parse as PHP5 |
|
||||
|
||||
Dump AST to stdout.
|
||||
|
@ -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
16
main.go
@ -21,12 +21,12 @@ var wg sync.WaitGroup
|
||||
var usePhp5 *bool
|
||||
var dumpType string
|
||||
var profiler string
|
||||
var showComments *bool
|
||||
var withMeta *bool
|
||||
var showResolvedNs *bool
|
||||
|
||||
func main() {
|
||||
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")
|
||||
flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]")
|
||||
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)
|
||||
}
|
||||
|
||||
if *withMeta {
|
||||
parserWorker.WithMeta()
|
||||
}
|
||||
|
||||
parserWorker.Parse()
|
||||
|
||||
src.Close()
|
||||
@ -138,31 +142,23 @@ func printer(result <-chan parser.Parser) {
|
||||
parserWorker.GetRootNode().Walk(nsResolver)
|
||||
}
|
||||
|
||||
var comments parser.Comments
|
||||
if *showComments {
|
||||
comments = parserWorker.GetComments()
|
||||
}
|
||||
|
||||
switch dumpType {
|
||||
case "custom":
|
||||
dumper := &visitor.Dumper{
|
||||
Writer: os.Stdout,
|
||||
Indent: "| ",
|
||||
Comments: comments,
|
||||
NsResolver: nsResolver,
|
||||
}
|
||||
parserWorker.GetRootNode().Walk(dumper)
|
||||
case "json":
|
||||
dumper := &visitor.JsonDumper{
|
||||
Writer: os.Stdout,
|
||||
Comments: comments,
|
||||
NsResolver: nsResolver,
|
||||
}
|
||||
parserWorker.GetRootNode().Walk(dumper)
|
||||
case "pretty_json":
|
||||
dumper := &visitor.PrettyJsonDumper{
|
||||
Writer: os.Stdout,
|
||||
Comments: comments,
|
||||
NsResolver: nsResolver,
|
||||
}
|
||||
parserWorker.GetRootNode().Walk(dumper)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package comment
|
||||
package meta
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
@ -25,6 +25,15 @@ func (c *Comment) SetTokenName(tokenName TokenName) {
|
||||
c.TokenName = tokenName
|
||||
}
|
||||
|
||||
// GetTokenName returns token name
|
||||
func (c *Comment) GetTokenName() TokenName {
|
||||
return c.TokenName
|
||||
}
|
||||
|
||||
func (c *Comment) String() string {
|
||||
return c.Value
|
||||
}
|
||||
|
||||
func (c *Comment) GetPosition() *position.Position {
|
||||
return c.Position
|
||||
}
|
44
meta/comment_test.go
Normal file
44
meta/comment_test.go
Normal 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
12
meta/meta.go
Normal 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
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package comment
|
||||
package meta
|
||||
|
||||
// TokenName is used to specify a comment position
|
||||
type TokenName int
|
37
meta/white_space.go
Normal file
37
meta/white_space.go
Normal 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
44
meta/white_space_test.go
Normal 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")
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Assign node
|
||||
type Assign struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Assign) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Assign) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Assign) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Assign) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Assign) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Reference node
|
||||
type Reference struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Reference) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Reference) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Reference) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Reference) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseAnd node
|
||||
type BitwiseAnd struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseAnd) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseAnd) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseAnd) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseOr node
|
||||
type BitwiseOr struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseOr) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseOr) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseOr) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseXor node
|
||||
type BitwiseXor struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseXor) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseXor) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseXor) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Concat node
|
||||
type Concat struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Concat) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Concat) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Concat) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Div node
|
||||
type Div struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Div) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Div) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Div) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Minus node
|
||||
type Minus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Minus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Minus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Minus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Mod node
|
||||
type Mod struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Mod) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Mod) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Mod) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Mul node
|
||||
type Mul struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Mul) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Mul) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Mul) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Plus node
|
||||
type Plus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Plus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Plus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Plus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Pow node
|
||||
type Pow struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Pow) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Pow) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Pow) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShiftLeft node
|
||||
type ShiftLeft struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShiftLeft) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShiftLeft) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShiftLeft) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package assign
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShiftRight node
|
||||
type ShiftRight struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Expression node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShiftRight) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShiftRight) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShiftRight) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseAnd node
|
||||
type BitwiseAnd struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseAnd) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseAnd) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseAnd) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseAnd) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseOr node
|
||||
type BitwiseOr struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseOr) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseOr) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseOr) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseOr) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseXor node
|
||||
type BitwiseXor struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BitwiseXor) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseXor) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseXor) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseXor) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BooleanAnd node
|
||||
type BooleanAnd struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BooleanAnd) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BooleanAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BooleanAnd) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BooleanAnd) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BooleanAnd) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BooleanOr node
|
||||
type BooleanOr struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *BooleanOr) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BooleanOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BooleanOr) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BooleanOr) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BooleanOr) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Coalesce node
|
||||
type Coalesce struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Coalesce) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Coalesce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Coalesce) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Coalesce) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Coalesce) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Concat node
|
||||
type Concat struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Concat) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Concat) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Concat) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Concat) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Concat) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Div node
|
||||
type Div struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Div) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Div) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Div) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Div) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Div) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Equal node
|
||||
type Equal struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Equal) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Equal) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Equal) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Equal) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Equal) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Greater node
|
||||
type Greater struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Greater) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Greater) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Greater) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Greater) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Greater) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// GreaterOrEqual node
|
||||
type GreaterOrEqual struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *GreaterOrEqual) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *GreaterOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *GreaterOrEqual) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *GreaterOrEqual) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *GreaterOrEqual) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Identical node
|
||||
type Identical struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Identical) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Identical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Identical) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Identical) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Identical) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// LogicalAnd node
|
||||
type LogicalAnd struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *LogicalAnd) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *LogicalAnd) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *LogicalAnd) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *LogicalAnd) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *LogicalAnd) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// LogicalOr node
|
||||
type LogicalOr struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *LogicalOr) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *LogicalOr) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *LogicalOr) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *LogicalOr) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *LogicalOr) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// LogicalXor node
|
||||
type LogicalXor struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *LogicalXor) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *LogicalXor) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *LogicalXor) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *LogicalXor) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *LogicalXor) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Minus node
|
||||
type Minus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Minus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Minus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Minus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Minus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Minus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Mod node
|
||||
type Mod struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Mod) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Mod) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Mod) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Mod) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Mod) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Mul node
|
||||
type Mul struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Mul) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Mul) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Mul) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Mul) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Mul) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// NotEqual node
|
||||
type NotEqual struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *NotEqual) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *NotEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *NotEqual) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *NotEqual) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *NotEqual) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// NotIdentical node
|
||||
type NotIdentical struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *NotIdentical) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *NotIdentical) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *NotIdentical) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *NotIdentical) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *NotIdentical) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Plus node
|
||||
type Plus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Plus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Plus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Plus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Plus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Plus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Pow node
|
||||
type Pow struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Pow) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Pow) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Pow) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Pow) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Pow) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShiftLeft node
|
||||
type ShiftLeft struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ShiftLeft) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShiftLeft) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShiftLeft) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShiftLeft) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShiftLeft) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShiftRight node
|
||||
type ShiftRight struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ShiftRight) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShiftRight) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShiftRight) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShiftRight) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShiftRight) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Smaller node
|
||||
type Smaller struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Smaller) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Smaller) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Smaller) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Smaller) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Smaller) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// SmallerOrEqual node
|
||||
type SmallerOrEqual struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *SmallerOrEqual) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *SmallerOrEqual) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *SmallerOrEqual) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *SmallerOrEqual) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *SmallerOrEqual) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package binary
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Spaceship node
|
||||
type Spaceship struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Left node.Node
|
||||
Right node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Spaceship) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Spaceship) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Spaceship) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Spaceship) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Spaceship) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Array node
|
||||
type Array struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Array) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Array) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Array) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Bool node
|
||||
type Bool struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Bool) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Bool) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Bool) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Bool) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Bool) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Double node
|
||||
type Double struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Double) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Double) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Double) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Double) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Double) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Int node
|
||||
type Int struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Int) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Int) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Int) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Int) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Int) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Object node
|
||||
type Object struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Object) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Object) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Object) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Object) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Object) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// String node
|
||||
type String struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *String) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *String) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *String) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *String) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *String) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Unset node
|
||||
type Unset struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Unset) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Unset) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Unset) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Unset) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Unset) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Array node
|
||||
type Array struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Items []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Array) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Array) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Array) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Array) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Array) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ArrayDimFetch node
|
||||
type ArrayDimFetch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Dim node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ArrayDimFetch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ArrayDimFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ArrayDimFetch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ArrayDimFetch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ArrayDimFetch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ArrayItem node
|
||||
type ArrayItem struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Key node.Node
|
||||
Val node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ArrayItem) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ArrayItem) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ArrayItem) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ArrayItem) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ArrayItem) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BitwiseNot node
|
||||
type BitwiseNot struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *BitwiseNot) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BitwiseNot) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BitwiseNot) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BitwiseNot) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BitwiseNot) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// BooleanNot node
|
||||
type BooleanNot struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *BooleanNot) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *BooleanNot) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *BooleanNot) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *BooleanNot) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *BooleanNot) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClassConstFetch node
|
||||
type ClassConstFetch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Class node.Node
|
||||
ConstantName node.Node
|
||||
@ -33,15 +33,12 @@ func (n *ClassConstFetch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClassConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClassConstFetch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClassConstFetch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClassConstFetch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Clone node
|
||||
type Clone struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Clone) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Clone) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Clone) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Clone) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Clone) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Closure node
|
||||
type Closure struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
ReturnsRef bool
|
||||
Static bool
|
||||
@ -43,15 +43,12 @@ func (n *Closure) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Closure) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Closure) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Closure) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Closure) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ClosureUse node
|
||||
type ClosureUse struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Uses []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ClosureUse) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ClosureUse) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ClosureUse) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ClosureUse) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ClosureUse) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ConstFetch node
|
||||
type ConstFetch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Constant node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ConstFetch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ConstFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ConstFetch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ConstFetch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ConstFetch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Die node
|
||||
type Die struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Die) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Die) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Die) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Die) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Die) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Empty node
|
||||
type Empty struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Empty) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Empty) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Empty) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Empty) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Empty) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ErrorSuppress node
|
||||
type ErrorSuppress struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ErrorSuppress) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ErrorSuppress) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ErrorSuppress) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ErrorSuppress) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ErrorSuppress) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Eval node
|
||||
type Eval struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Eval) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Eval) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Eval) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Eval) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Eval) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Exit node
|
||||
type Exit struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Exit) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Exit) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Exit) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Exit) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Exit) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// FunctionCall node
|
||||
type FunctionCall struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Function node.Node
|
||||
ArgumentList *node.ArgumentList
|
||||
@ -33,15 +33,12 @@ func (n *FunctionCall) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *FunctionCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *FunctionCall) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *FunctionCall) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *FunctionCall) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Include node
|
||||
type Include struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Include) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Include) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Include) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Include) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Include) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// IncludeOnce node
|
||||
type IncludeOnce struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *IncludeOnce) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *IncludeOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *IncludeOnce) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *IncludeOnce) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *IncludeOnce) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// InstanceOf node
|
||||
type InstanceOf struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
Class node.Node
|
||||
@ -33,15 +33,12 @@ func (n *InstanceOf) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *InstanceOf) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *InstanceOf) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *InstanceOf) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *InstanceOf) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Isset node
|
||||
type Isset struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variables []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Isset) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Isset) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Isset) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Isset) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Isset) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// List node
|
||||
type List struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Items []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *List) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *List) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *List) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *List) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *List) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// MethodCall node
|
||||
type MethodCall struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Method node.Node
|
||||
@ -35,15 +35,12 @@ func (n *MethodCall) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *MethodCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *MethodCall) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *MethodCall) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *MethodCall) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// New node
|
||||
type New struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Class node.Node
|
||||
ArgumentList *node.ArgumentList
|
||||
@ -33,15 +33,12 @@ func (n *New) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *New) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *New) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *New) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *New) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PostDec node
|
||||
type PostDec struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *PostDec) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PostDec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PostDec) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PostDec) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PostDec) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PostInc node
|
||||
type PostInc struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *PostInc) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PostInc) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PostInc) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PostInc) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PostInc) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PreDec node
|
||||
type PreDec struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *PreDec) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PreDec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PreDec) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PreDec) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PreDec) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PreInc node
|
||||
type PreInc struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *PreInc) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PreInc) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PreInc) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PreInc) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PreInc) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Print node
|
||||
type Print struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Print) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Print) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Print) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Print) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Print) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// PropertyFetch node
|
||||
type PropertyFetch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
Property node.Node
|
||||
@ -33,15 +33,12 @@ func (n *PropertyFetch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *PropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *PropertyFetch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *PropertyFetch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *PropertyFetch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Reference node
|
||||
type Reference struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Variable node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Reference) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Reference) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Reference) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Reference) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Reference) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Require node
|
||||
type Require struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Require) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Require) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Require) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Require) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Require) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// RequireOnce node
|
||||
type RequireOnce struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *RequireOnce) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *RequireOnce) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *RequireOnce) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *RequireOnce) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *RequireOnce) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShellExec node
|
||||
type ShellExec struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Parts []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ShellExec) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShellExec) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShellExec) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShellExec) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShellExec) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShortArray node
|
||||
type ShortArray struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Items []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ShortArray) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShortArray) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShortArray) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShortArray) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShortArray) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// ShortList node
|
||||
type ShortList struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Items []node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *ShortList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *ShortList) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *ShortList) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *ShortList) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *ShortList) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// StaticCall node
|
||||
type StaticCall struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Class node.Node
|
||||
Call node.Node
|
||||
@ -35,15 +35,12 @@ func (n *StaticCall) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *StaticCall) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *StaticCall) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *StaticCall) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *StaticCall) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// StaticPropertyFetch node
|
||||
type StaticPropertyFetch struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Class node.Node
|
||||
Property node.Node
|
||||
@ -33,15 +33,12 @@ func (n *StaticPropertyFetch) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *StaticPropertyFetch) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *StaticPropertyFetch) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *StaticPropertyFetch) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *StaticPropertyFetch) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Ternary node
|
||||
type Ternary struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Condition node.Node
|
||||
IfTrue node.Node
|
||||
@ -35,15 +35,12 @@ func (n *Ternary) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Ternary) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Ternary) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Ternary) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Ternary) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// UnaryMinus node
|
||||
type UnaryMinus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *UnaryMinus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *UnaryMinus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *UnaryMinus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *UnaryMinus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *UnaryMinus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// UnaryPlus node
|
||||
type UnaryPlus struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *UnaryPlus) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *UnaryPlus) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *UnaryPlus) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *UnaryPlus) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *UnaryPlus) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Variable node
|
||||
type Variable struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
VarName node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *Variable) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Variable) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Variable) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Variable) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Variable) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// Yield node
|
||||
type Yield struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Key node.Node
|
||||
Value node.Node
|
||||
@ -33,15 +33,12 @@ func (n *Yield) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *Yield) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *Yield) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *Yield) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *Yield) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
@ -1,7 +1,7 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/comment"
|
||||
"github.com/z7zmey/php-parser/meta"
|
||||
"github.com/z7zmey/php-parser/node"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
"github.com/z7zmey/php-parser/walker"
|
||||
@ -9,7 +9,7 @@ import (
|
||||
|
||||
// YieldFrom node
|
||||
type YieldFrom struct {
|
||||
Comments []*comment.Comment
|
||||
Meta []meta.Meta
|
||||
Position *position.Position
|
||||
Expr node.Node
|
||||
}
|
||||
@ -31,15 +31,12 @@ func (n *YieldFrom) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
func (n *YieldFrom) AddComments(cc []*comment.Comment, tn comment.TokenName) {
|
||||
for _, c := range cc {
|
||||
c.SetTokenName(tn)
|
||||
}
|
||||
n.Comments = append(n.Comments, cc...)
|
||||
func (n *YieldFrom) AddMeta(m []meta.Meta) {
|
||||
n.Meta = append(n.Meta, m...)
|
||||
}
|
||||
|
||||
func (n *YieldFrom) GetComments() []*comment.Comment {
|
||||
return n.Comments
|
||||
func (n *YieldFrom) GetMeta() []meta.Meta {
|
||||
return n.Meta
|
||||
}
|
||||
|
||||
// Attributes returns node attributes as map
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user