2017-12-03 20:49:18 +02:00
|
|
|
package node
|
|
|
|
|
2018-01-05 13:01:14 +02:00
|
|
|
import "fmt"
|
|
|
|
|
2017-12-31 12:59:22 +02:00
|
|
|
type Node interface {
|
2017-12-31 11:57:55 +02:00
|
|
|
Attributes() map[string]interface{}
|
2018-01-04 22:09:48 +02:00
|
|
|
Walk(v Visitor)
|
2017-12-31 11:57:55 +02:00
|
|
|
}
|
|
|
|
|
2017-12-31 12:59:22 +02:00
|
|
|
type Position struct {
|
|
|
|
StartLine int
|
|
|
|
EndLine int
|
2018-01-05 13:01:14 +02:00
|
|
|
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)
|
2017-12-03 20:49:18 +02:00
|
|
|
}
|