go/src/cmd/compile/internal/syntax/pos.go

const PosMax

type Pos

// MakePos returns a new Pos for the given PosBase, line and column.
func MakePos(base *PosBase, line, col uint) Pos {}

func (pos Pos) Pos() Pos       {}

func (pos Pos) IsKnown() bool  {}

func (pos Pos) Base() *PosBase {}

func (pos Pos) Line() uint     {}

func (pos Pos) Col() uint      {}

// FileBase returns the PosBase of the file containing pos,
// skipping over intermediate PosBases from //line directives.
// The result is nil if pos doesn't have a file base.
func (pos Pos) FileBase() *PosBase {}

func (pos Pos) RelFilename() string {}

func (pos Pos) RelLine() uint {}

func (pos Pos) RelCol() uint {}

// Cmp compares the positions p and q and returns a result r as follows:
//
//	r <  0: p is before q
//	r == 0: p and q are the same position (but may not be identical)
//	r >  0: p is after q
//
// If p and q are in different files, p is before q if the filename
// of p sorts lexicographically before the filename of q.
func (p Pos) Cmp(q Pos) int {}

func (pos Pos) String() string {}

type position_

func (p position_) String() string {}

type PosBase

// NewFileBase returns a new PosBase for the given filename.
// A file PosBase's position is relative to itself, with the
// position being filename:1:1.
func NewFileBase(filename string) *PosBase {}

// NewTrimmedFileBase is like NewFileBase, but allows specifying Trimmed.
func NewTrimmedFileBase(filename string, trimmed bool) *PosBase {}

// NewLineBase returns a new PosBase for a line directive "line filename:line:col"
// relative to pos, which is the position of the character immediately following
// the comment containing the line directive. For a directive in a line comment,
// that position is the beginning of the next line (i.e., the newline character
// belongs to the line comment).
func NewLineBase(pos Pos, filename string, trimmed bool, line, col uint) *PosBase {}

func (base *PosBase) IsFileBase() bool {}

func (base *PosBase) Pos() (_ Pos) {}

func (base *PosBase) Filename() string {}

func (base *PosBase) Line() uint {}

func (base *PosBase) Col() uint {}

func (base *PosBase) Trimmed() bool {}

func sat32(x uint) uint32 {}