refactoring: move internal nodes
This commit is contained in:
parent
bd479007be
commit
07f49a4d21
85
internal/php5/node.go
Normal file
85
internal/php5/node.go
Normal file
@ -0,0 +1,85 @@
|
||||
package php5
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type ParserBrackets struct {
|
||||
Position *position.Position
|
||||
OpenBracketTkn *token.Token
|
||||
Child ast.Vertex
|
||||
CloseBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
type ParserSeparatedList struct {
|
||||
Position *position.Position
|
||||
Items []ast.Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitAdaptationList node
|
||||
type TraitAdaptationList struct {
|
||||
Position *position.Position
|
||||
OpenCurlyBracketTkn *token.Token
|
||||
Adaptations []ast.Vertex
|
||||
CloseCurlyBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// ArgumentList node
|
||||
type ArgumentList struct {
|
||||
Position *position.Position
|
||||
OpenParenthesisTkn *token.Token
|
||||
Arguments []ast.Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
CloseParenthesisTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ArgumentList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ArgumentList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitMethodRef node
|
||||
type TraitMethodRef struct {
|
||||
Position *position.Position
|
||||
Trait ast.Vertex
|
||||
DoubleColonTkn *token.Token
|
||||
Method ast.Vertex
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
BIN
internal/php5/php5.go
generated
BIN
internal/php5/php5.go
generated
Binary file not shown.
File diff suppressed because it is too large
Load Diff
99
internal/php7/node.go
Normal file
99
internal/php7/node.go
Normal file
@ -0,0 +1,99 @@
|
||||
package php7
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/ast"
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
)
|
||||
|
||||
type ParserBrackets struct {
|
||||
Position *position.Position
|
||||
OpenBracketTkn *token.Token
|
||||
Child ast.Vertex
|
||||
CloseBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
type ParserSeparatedList struct {
|
||||
Position *position.Position
|
||||
Items []ast.Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitAdaptationList node
|
||||
type TraitAdaptationList struct {
|
||||
Position *position.Position
|
||||
OpenCurlyBracketTkn *token.Token
|
||||
Adaptations []ast.Vertex
|
||||
CloseCurlyBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// ArgumentList node
|
||||
type ArgumentList struct {
|
||||
Position *position.Position
|
||||
OpenParenthesisTkn *token.Token
|
||||
Arguments []ast.Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
CloseParenthesisTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ArgumentList) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ArgumentList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
type ReturnType struct {
|
||||
Position *position.Position
|
||||
ColonTkn *token.Token
|
||||
Type ast.Vertex
|
||||
}
|
||||
|
||||
func (n *ReturnType) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ReturnType) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitMethodRef node
|
||||
type TraitMethodRef struct {
|
||||
Position *position.Position
|
||||
Trait ast.Vertex
|
||||
DoubleColonTkn *token.Token
|
||||
Method ast.Vertex
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) Accept(v ast.Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
BIN
internal/php7/php7.go
generated
BIN
internal/php7/php7.go
generated
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -2644,97 +2644,3 @@ func (n *NameNamePart) Accept(v Visitor) {
|
||||
func (n *NameNamePart) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TODO: move to private section
|
||||
|
||||
type ParserBrackets struct {
|
||||
Position *position.Position
|
||||
OpenBracketTkn *token.Token
|
||||
Child Vertex
|
||||
CloseBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserBrackets) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
type ParserSeparatedList struct {
|
||||
Position *position.Position
|
||||
Items []Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ParserSeparatedList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitAdaptationList node
|
||||
type TraitAdaptationList struct {
|
||||
Position *position.Position
|
||||
OpenCurlyBracketTkn *token.Token
|
||||
Adaptations []Vertex
|
||||
CloseCurlyBracketTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitAdaptationList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// ArgumentList node
|
||||
type ArgumentList struct {
|
||||
Position *position.Position
|
||||
OpenParenthesisTkn *token.Token
|
||||
Arguments []Vertex
|
||||
SeparatorTkns []*token.Token
|
||||
CloseParenthesisTkn *token.Token
|
||||
}
|
||||
|
||||
func (n *ArgumentList) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ArgumentList) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
type ReturnType struct {
|
||||
Position *position.Position
|
||||
ColonTkn *token.Token
|
||||
Type Vertex
|
||||
}
|
||||
|
||||
func (n *ReturnType) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *ReturnType) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
||||
// TraitMethodRef node
|
||||
type TraitMethodRef struct {
|
||||
Position *position.Position
|
||||
Trait Vertex
|
||||
DoubleColonTkn *token.Token
|
||||
Method Vertex
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) Accept(v Visitor) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
func (n *TraitMethodRef) GetPosition() *position.Position {
|
||||
return n.Position
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user