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

Method isNewLine

caddyconfig/caddyfile/dispenser.go:504–515  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

502// line (higher line number) than the previous token. It handles imported
503// tokens correctly. If there isn't a previous token, it returns true.
504func (d *Dispenser) isNewLine() bool {
505 if d.cursor < 1 {
506 return true
507 }
508 if d.cursor > len(d.tokens)-1 {
509 return false
510 }
511
512 prev := d.tokens[d.cursor-1]
513 curr := d.tokens[d.cursor]
514 return isNextOnNewLine(prev, curr)
515}
516
517// isNextOnNewLine determines whether the current token is on a different
518// line (higher line number) than the next token. It handles imported

Callers 2

addressesMethod · 0.80
directiveMethod · 0.80

Calls 1

isNextOnNewLineFunction · 0.85

Tested by

no test coverage detected