refactor position package
This commit is contained in:
parent
3b9ef2b56d
commit
aab9da03f0
@ -1,14 +1,14 @@
|
||||
package ast
|
||||
|
||||
import (
|
||||
"github.com/z7zmey/php-parser/pkg/position"
|
||||
"github.com/z7zmey/php-parser/pkg/token"
|
||||
"github.com/z7zmey/php-parser/position"
|
||||
)
|
||||
|
||||
type Node struct {
|
||||
StartTokens []token.Token
|
||||
EndTokens []token.Token
|
||||
Position *position.Position
|
||||
StartTokens []token.Token
|
||||
EndTokens []token.Token
|
||||
Position *position.Position
|
||||
}
|
||||
|
||||
func (n *Node) GetNode() *Node {
|
||||
|
@ -1,9 +1,5 @@
|
||||
package position
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Position represents node position
|
||||
type Position struct {
|
||||
StartLine int
|
||||
@ -21,7 +17,3 @@ func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position
|
||||
EndPos: EndPos,
|
||||
}
|
||||
}
|
||||
|
||||
func (p Position) String() string {
|
||||
return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user