Mercurial > octave
diff libinterp/parse-tree/parse.h @ 24361:8bcfddad15ec
use shared_ptr to manage symbol_scope objects
* symscope.h, symscope.cc (symbol_scope_rep): New class, renamed and
adapted from symbol_scope.
(symbol_scope): New class to manage symbol_scope_rep with shared_ptr.
Change all uses of pointers ot symbol_scope objects to be symbol_scope
objects or, in a few cases, pointers to symbol_scope_rep objects
instead.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 27 Nov 2017 01:12:05 -0500 |
parents | bc3819b7cca1 |
children | 3fc24b792a24 |
line wrap: on
line diff
--- a/libinterp/parse-tree/parse.h Tue Dec 05 11:35:11 2017 -0800 +++ b/libinterp/parse-tree/parse.h Mon Nov 27 01:12:05 2017 -0500 @@ -101,7 +101,7 @@ { public: - typedef std::pair<symbol_scope*, std::string> value_type; + typedef std::pair<symbol_scope, std::string> value_type; typedef std::deque<value_type>::iterator iterator; typedef std::deque<value_type>::const_iterator const_iterator; @@ -121,7 +121,7 @@ void push (const value_type& elt); - void push (symbol_scope *id); + void push (const symbol_scope& id); void pop (void); @@ -129,7 +129,7 @@ bool name_current_scope (const std::string& name); - symbol_scope *parent_scope (void) const; + symbol_scope parent_scope (void) const; std::string parent_name (void) const; @@ -448,7 +448,7 @@ // Scope where we install all subfunctions and nested functions. Only // used while reading function files. - symbol_scope *m_primary_fcn_scope; + symbol_scope m_primary_fcn_scope; // Name of the current class when we are parsing class methods or // constructors.