(op string)
| 75 | } |
| 76 | |
| 77 | func (p *parser) popExpectOp(op string) (*token, errors.StaticError) { |
| 78 | t := p.pop() |
| 79 | if t.kind != tokenOperator || t.data != op { |
| 80 | return nil, errors.MakeStaticError( |
| 81 | fmt.Sprintf("Expected operator %v but got %v", op, t), t.loc) |
| 82 | } |
| 83 | return t, nil |
| 84 | } |
| 85 | |
| 86 | func (p *parser) peek() *token { |
| 87 | return &p.t[p.currT] |
no test coverage detected