next returns the next token.
()
| 31 | |
| 32 | // next returns the next token. |
| 33 | func (p *parser) next() item { |
| 34 | if p.peekItem != nil { |
| 35 | itm := *p.peekItem |
| 36 | p.peekItem = nil |
| 37 | return itm |
| 38 | } |
| 39 | nxt := p.lex.nextSignificantItem() |
| 40 | if nxt.typ == itemError { |
| 41 | p.errorf("%s", nxt.val) |
| 42 | } |
| 43 | return nxt |
| 44 | } |
| 45 | |
| 46 | func anyType(t itemType, allowed []itemType) bool { |
| 47 | for _, i := range allowed { |
no test coverage detected