refactor position package
This commit is contained in:
parent
3b9ef2b56d
commit
aab9da03f0
@ -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 {
|
||||||
|
@ -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)
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user