Lines Matching defs:Range
22 // Range represents a source code range in token.Pos form.
25 type Range struct {
39 // NewRange creates a new Range from a FileSet and two positions.
41 func NewRange(fset *token.FileSet, start, end token.Pos) Range {
42 return Range{
65 func (r Range) IsPoint() bool {
69 // Span converts a Range to a Span that represents the Range.
72 func (r Range) Span() (Span, error) {
105 // Range converts a Span to a Range that represents the Span for the supplied
107 func (s Span) Range(converter *TokenConverter) (Range, error) {
110 return Range{}, err
115 return Range{}, fmt.Errorf("start offset %v is past the end of the file %v", s.Start(), converter.file.Size())
118 return Range{}, fmt.Errorf("end offset %v is past the end of the file %v", s.End(), converter.file.Size())
120 return Range{