(types ...itemType)
| 70 | } |
| 71 | |
| 72 | func (p *parser) collect(types ...itemType) []item { |
| 73 | itms := []item{} |
| 74 | for { |
| 75 | nxt := p.peek() |
| 76 | if anyType(nxt.typ, types) { |
| 77 | itms = append(itms, p.next()) |
| 78 | } else { |
| 79 | break |
| 80 | } |
| 81 | } |
| 82 | return itms |
| 83 | } |
| 84 | |
| 85 | func (p *parser) collectValues(types ...itemType) []string { |
| 86 | items := p.collect(types...) |
no test coverage detected