Shape returns the shape of the given range in the input. Will panic if the range is not a subslice of the input.
(r Range)
| 143 | // Shape returns the shape of the given range in the input. Will |
| 144 | // panic if the range is not a subslice of the input. |
| 145 | func (p *Parser) Shape(r Range) Shape { |
| 146 | raw := p.Raw(r) |
| 147 | return Shape{ |
| 148 | Start: p.position(int(r.Offset)), |
| 149 | End: p.position(int(r.Offset) + len(raw)), |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | // Expression returns a pointer to the node representing the last successfully |
| 154 | // parsed expression. |