Lines Matching refs:Position
26 // A source position is represented by a Position value.
27 // A position is valid if Line > 0.
28 type Position struct {
35 // IsValid reports whether the position is valid.
36 func (pos *Position) IsValid() bool { return pos.Line > 0 }
38 func (pos Position) String() string {
118 srcPos int // reading position (srcBuf index)
121 // Source position
133 tokPos int // token text tail position (srcBuf index); valid if >= 0
164 // Start position of most recently scanned token; set by Scan.
165 // Calling Init or Next invalidates the position (Line == 0).
167 // If an error is reported (via Error) and Position is invalid,
169 // position in that case.
170 Position
185 // initialize source position
204 s.Line = 0 // invalidate token position
264 // advance for correct error position
297 // update the Scanner's Position field; use Pos() to
298 // get the current position.
301 s.Line = 0 // invalidate token position
310 // the scanner. It returns EOF if the scanner's position is at the last
329 pos := s.Position
541 // reset token text position
555 // set token position
638 // Pos returns the position of the character immediately after
640 Position) {