Showing the changes to src/core/chuck_frame.cpp (1 of 17 files). Show all
Unified · Split
| @@ -100,7 +100,7 @@ void Chuck_Frame::push_scope( ) · 99 unmodified lines | |||
| 100 | // name: get_scope() | 100 | // name: get_scope() |
| 101 | // desc: get current scope (added 1.3.0.0) | 101 | // desc: get current scope (added 1.3.0.0) |
| 102 | //----------------------------------------------------------------------------- | 102 | //----------------------------------------------------------------------------- |
| 103 | void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const | 103 | void Chuck_Frame::get_scope( vector<Chuck_Local *> & out, bool localOnly ) const |
| 104 | { | 104 | { |
| 105 | // sanity | 105 | // sanity |
| 106 | assert( this->stack.size() > 0 ); | 106 | assert( this->stack.size() > 0 ); |
| @@ -111,8 +111,13 @@ void Chuck_Frame::get_scope( vector<Chuck_Local *> & out ) const · 4 unmodified lines | |||
| 111 | t_CKINT index = this->stack.size() - 1; | 111 | t_CKINT index = this->stack.size() - 1; |
| 112 | 112 | ||
| 113 | // loop | 113 | // loop |
| 114 | while( index >= 0 && this->stack[index] != NULL ) | 114 | while( index >= 0 ) |
| 115 | { | 115 | { |
| 116 | // did we hit a stack boundary (delineated by NULL) | ||
| 117 | // localOnly option added 1.4.2.1 (ge) -- to get all scope in the frame | ||
| 118 | if( localOnly && this->stack[index] != NULL ) | ||
| 119 | break; | ||
| 120 | |||
| 116 | // last thing | 121 | // last thing |
| 117 | local = stack[index]; | 122 | local = stack[index]; |
| 118 | // move | 123 | // move |