forked from jhump/protoreflect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
source_pos.go
29 lines (25 loc) · 887 Bytes
/
source_pos.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ast
import (
"github.com/bufbuild/protocompile/ast"
)
// SourcePos identifies a location in a proto source file.
type SourcePos = ast.SourcePos
// PosRange is a range of positions in a source file that indicates
// the span of some region of source, such as a single token or
// a sub-tree of the AST.
type PosRange struct {
Start, End SourcePos
}
// Comment represents a single comment in a source file. It indicates
// the position of the comment and its contents.
type Comment struct {
// The location of the comment in the source file.
PosRange
// Any whitespace between the prior lexical element (either a token
// or other comment) and this comment.
LeadingWhitespace string
// The text of the comment, including any "//" or "/*" and "*/"
// symbols at the start and end. Single-line comments will include
// the trailing newline rune in Text.
Text string
}