From aab9da03f0605df8ec89d2effbbdfa76183af2de Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 10 May 2020 08:53:17 +0300 Subject: [PATCH] refactor position package --- pkg/ast/node.go | 8 ++++---- pkg/position/position.go | 8 -------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 13b285c..b8b486e 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -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 { diff --git a/pkg/position/position.go b/pkg/position/position.go index d4099cd..ffe4746 100644 --- a/pkg/position/position.go +++ b/pkg/position/position.go @@ -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) -}