refactor position package
This commit is contained in:
parent
3b9ef2b56d
commit
aab9da03f0
@ -1,14 +1,14 @@
|
|||||||
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 {
|
||||||
StartTokens []token.Token
|
StartTokens []token.Token
|
||||||
EndTokens []token.Token
|
EndTokens []token.Token
|
||||||
Position *position.Position
|
Position *position.Position
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) GetNode() *Node {
|
func (n *Node) GetNode() *Node {
|
||||||
|
@ -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