GetCurrentLabel traverses the stack (starting from the top) returning the first label found. Returns an empty string if no labels were set.
()
| 96 | // GetCurrentLabel traverses the stack (starting from the top) returning the first label found. Returns an empty string |
| 97 | // if no labels were set. |
| 98 | func (is *InterpreterStack) GetCurrentLabel() string { |
| 99 | for i := 0; i < is.stack.Len(); i++ { |
| 100 | label := is.stack.PeekDepth(i).label |
| 101 | if len(label) > 0 { |
| 102 | return label |
| 103 | } |
| 104 | } |
| 105 | return "" |
| 106 | } |
| 107 | |
| 108 | // GetVariable traverses the stack (starting from the top) to find a variable with a matching name. Returns nil if no |
| 109 | // variable was found. |
no test coverage detected