Allows syntax.Pos values to implement
interface {
Pos() Pos
}
Preparation step for types2 package.
Change-Id: Ib0f4d7695a3d066983567d680fc3b9256a31c31d
Reviewed-on: https://go-review.googlesource.com/c/go/+/263622
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
// TODO(gri) IsKnown makes an assumption about linebase < 1.
// Maybe we should check for Base() != nil instead.
+func (pos Pos) Pos() Pos { return pos }
func (pos Pos) IsKnown() bool { return pos.line > 0 }
func (pos Pos) Base() *PosBase { return pos.base }
func (pos Pos) Line() uint { return uint(pos.line) }