handle node position in file

This commit is contained in:
vadim
2018-01-05 13:01:14 +02:00
parent dac789d601
commit c99f15a646
6 changed files with 419 additions and 339 deletions

View File

@@ -1,5 +1,7 @@
package node
import "fmt"
type Node interface {
Positioner
Attributes() map[string]interface{}
@@ -14,4 +16,10 @@ type Positioner interface {
type Position struct {
StartLine int
EndLine int
StartPos int
EndPos int
}
func (p Position) String() string {
return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos)
}