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

Method isNextOnNewLine

caddyconfig/caddyfile/dispenser.go:520–531  ·  view source on GitHub ↗

isNextOnNewLine determines whether the current token is on a different line (higher line number) than the next token. It handles imported tokens correctly. If there isn't a next token, it returns true.

()

Source from the content-addressed store, hash-verified

518// line (higher line number) than the next token. It handles imported
519// tokens correctly. If there isn't a next token, it returns true.
520func (d *Dispenser) isNextOnNewLine() bool {
521 if d.cursor < 0 {
522 return false
523 }
524 if d.cursor >= len(d.tokens)-1 {
525 return true
526 }
527
528 curr := d.tokens[d.cursor]
529 next := d.tokens[d.cursor+1]
530 return isNextOnNewLine(curr, next)
531}
532
533const MatcherNameCtxKey = "matcher_name"

Callers 1

directiveMethod · 0.80

Calls 1

isNextOnNewLineFunction · 0.85

Tested by

no test coverage detected