MCPcopy
hub / github.com/caddyserver/caddy / nextOnSameLine

Method nextOnSameLine

caddyconfig/caddyfile/dispenser.go:103–118  ·  caddyconfig/caddyfile/dispenser.go::Dispenser.nextOnSameLine

nextOnSameLine advances the cursor if the next token is on the same line of the same file.

()

Source from the content-addressed store, hash-verified

101// nextOnSameLine advances the cursor if the next
102// token is on the same line of the same file.
103func (d *Dispenser) nextOnSameLine() bool {
104 if d.cursor < 0 {
105 d.cursor++
106 return true
107 }
108 if d.cursor >= len(d.tokens)-1 {
109 return false
110 }
111 curr := d.tokens[d.cursor]
112 next := d.tokens[d.cursor+1]
113 if !isNextOnNewLine(curr, next) {
114 d.cursor++
115 return true
116 }
117 return false
118}
119
120// NextLine loads the next token only if it is not on the same
121// line as the current token, and returns true if a token was

Callers 2

NextArgMethod · 0.95
NextBlockMethod · 0.95

Calls 1

isNextOnNewLineFunction · 0.85

Tested by

no test coverage detected