(allowed ...itemType)
| 53 | } |
| 54 | |
| 55 | func (p *parser) mustNext(allowed ...itemType) item { |
| 56 | nxt := p.next() |
| 57 | if !anyType(nxt.typ, allowed) { |
| 58 | p.errorf("invalid syntax") |
| 59 | } |
| 60 | return nxt |
| 61 | } |
| 62 | |
| 63 | // peek returns but does not consume the next token. |
| 64 | func (p *parser) peek() item { |
no test coverage detected