nextOnSameLine advances the cursor if the next token is on the same line of the same file.
()
| 101 | // nextOnSameLine advances the cursor if the next |
| 102 | // token is on the same line of the same file. |
| 103 | func (d *Dispenser) nextOnSameLine() bool { |
| 104 | if d.cursor < 0 { |
| 105 | d.cursor++ |
| 106 | return true |
| 107 | } |
| 108 | if d.cursor >= len(d.tokens)-1 { |
| 109 | return false |
| 110 | } |
| 111 | curr := d.tokens[d.cursor] |
| 112 | next := d.tokens[d.cursor+1] |
| 113 | if !isNextOnNewLine(curr, next) { |
| 114 | d.cursor++ |
| 115 | return true |
| 116 | } |
| 117 | return false |
| 118 | } |
| 119 | |
| 120 | // NextLine loads the next token only if it is not on the same |
| 121 | // line as the current token, and returns true if a token was |
no test coverage detected