Debian Codegraph @

position.go

raw symbols SCIP
1 package ssh_configscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/
2
3 import "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/"
4
5 // Position of a document element within a SSH document.
6 //
7 // Line and Col are both 1-indexed positions for the element's line number and
8 // column number, respectively. Values of zero or less will cause Invalid(),
9 // to return true.
10 type Positionscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position# struct {
11 Linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Line. int // line within the document
12 Colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Col. int // column within the line
13 }
14
15 // String representation of the position.
16 // Displays 1-indexed line and column numbers.
17 func (p Positionscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#) Stringscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#String().() string {
18 return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.18 fmt/Sprintf().("(%d, %d)", p.Linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Line., p.Colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Col.)
19 }
20
21 // Invalid returns whether or not the position is valid (i.e. with negative or
22 // null values)
23 func (p Positionscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#) Invalidscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Invalid().() bool {
24 return p.Linescip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Line. <= 0 || p.Colscip-go gomod github.com/dimonomid/ssh_config . `github.com/dimonomid/ssh_config`/Position#Col. <= 0
25 }