peekToken returns the next token without advancing the parser position. Returns an empty TokenWithSpan if at the end of input.
()
| 862 | // peekToken returns the next token without advancing the parser position. |
| 863 | // Returns an empty TokenWithSpan if at the end of input. |
| 864 | func (p *Parser) peekToken() models.TokenWithSpan { |
| 865 | nextPos := p.currentPos + 1 |
| 866 | if nextPos < len(p.tokens) { |
| 867 | return p.tokens[nextPos] |
| 868 | } |
| 869 | return models.TokenWithSpan{} |
| 870 | } |
| 871 | |
| 872 | // ============================================================================= |
| 873 | // Type-based Helper Methods (Fast Int Comparisons) |
no outgoing calls
no test coverage detected