Reset clears the parser state for reuse from the pool.
()
| 112 | |
| 113 | // Reset clears the parser state for reuse from the pool. |
| 114 | func (p *Parser) Reset() { |
| 115 | p.tokens = p.tokens[:0] |
| 116 | p.currentPos = 0 |
| 117 | p.currentToken = models.TokenWithSpan{} |
| 118 | p.depth = 0 |
| 119 | p.ctx = nil |
| 120 | p.strict = false |
| 121 | p.dialect = "" |
| 122 | } |
| 123 | |
| 124 | // currentLocation returns the source location of the current token. |
| 125 | // Span information is embedded directly in models.TokenWithSpan so no |
no outgoing calls