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.
()
| 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. |
| 520 | func (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 | |
| 533 | const MatcherNameCtxKey = "matcher_name" |
no test coverage detected