def _walk_js_scopes(scope, lpath=None):
 if (lpath is None):
  lpath = []
 for subscope in scope:
  if ((subscope.tag == 'variable') and (not subscope)):
   continue
  sublpath = (lpath + [subscope.get('name')])
  (yield (subscope, sublpath))
  for r in _walk_js_scopes(subscope, sublpath):
   (yield r)

def _walk_js_scopes ( scope , lpath = None ) : if ( lpath is None ) : lpath = [ ] for subscope in scope : if ( ( subscope . tag == 'variable' ) and ( not subscope ) ) : continue sublpath = ( lpath + [ subscope . get ( 'name' ) ] ) ( yield ( subscope , sublpath ) ) for r in _walk_js_scopes ( subscope , sublpath ) : ( yield r )
walk the subscopes of the given element .