()
| 31 | } |
| 32 | |
| 33 | func (s *mathTreeStack) pop() (*MathTree, error) { |
| 34 | if s.empty() { |
| 35 | return nil, errors.Errorf("Empty stack") |
| 36 | } |
| 37 | last := s.a[len(s.a)-1] |
| 38 | s.a = s.a[:len(s.a)-1] |
| 39 | return last, nil |
| 40 | } |
| 41 | |
| 42 | func (s *mathTreeStack) peek() *MathTree { |
| 43 | x.AssertTruef(!s.empty(), "Trying to peek empty stack") |
no test coverage detected