MCPcopy Create free account
hub / github.com/foxcpp/maddy / numLineBreaks

Method numLineBreaks

framework/config/lexer/dispenser.go:259–264  ·  view source on GitHub ↗

numLineBreaks counts how many line breaks are in the token value given by the token index tknIdx. It returns 0 if the token does not exist or there are no line breaks.

(tknIdx int)

Source from the content-addressed store, hash-verified

257// value given by the token index tknIdx. It returns 0 if the
258// token does not exist or there are no line breaks.
259func (d *Dispenser) numLineBreaks(tknIdx int) int {
260 if tknIdx < 0 || tknIdx >= len(d.tokens) {
261 return 0
262 }
263 return strings.Count(d.tokens[tknIdx].Text, "\n")
264}

Callers 2

NextArgMethod · 0.95
NextLineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected