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.
()
| 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. |
| 504 | func (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 |
no test coverage detected