index returns the index of the top-most occurrence of n in the stack, or -1 if n is not present.
(n *Node)
| 176 | // index returns the index of the top-most occurrence of n in the stack, or -1 |
| 177 | // if n is not present. |
| 178 | func (s *nodeStack) index(n *Node) int { |
| 179 | for i := len(*s) - 1; i >= 0; i-- { |
| 180 | if (*s)[i] == n { |
| 181 | return i |
| 182 | } |
| 183 | } |
| 184 | return -1 |
| 185 | } |
| 186 | |
| 187 | // contains returns whether a is within s. |
| 188 | func (s *nodeStack) contains(a atom.Atom) bool { |
no outgoing calls
no test coverage detected