refactor position package

This commit is contained in:
Vadym Slizov 2020-05-10 08:53:17 +03:00
parent 3b9ef2b56d
commit aab9da03f0
2 changed files with 4 additions and 12 deletions

View File

@ -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 {

View File

@ -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)
}