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,8 +1,8 @@
package ast package ast
import ( import (
"github.com/z7zmey/php-parser/pkg/position"
"github.com/z7zmey/php-parser/pkg/token" "github.com/z7zmey/php-parser/pkg/token"
"github.com/z7zmey/php-parser/position"
) )
type Node struct { type Node struct {

View File

@ -1,9 +1,5 @@
package position package position
import (
"fmt"
)
// Position represents node position // Position represents node position
type Position struct { type Position struct {
StartLine int StartLine int
@ -21,7 +17,3 @@ func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position
EndPos: EndPos, 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)
}