Changes in / [046959b:242f705]


Ignore:
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/ScopedMap.h

    r046959b r242f705  
    3333        struct Scope {
    3434                MapType map;
    35                 Note note;
    36 
    37                 template<typename N>
    38                 Scope(N&& n) : map(), note(std::forward<N>(n)) {}
    39                
    40                 Scope() = default;
    41                 Scope(const Scope&) = default;
    42                 Scope(Scope&&) = default;
    43                 Scope& operator= (const Scope&) = default;
    44                 Scope& operator= (Scope&&) = default;
     35                Note note;     
    4536        };
    4637        typedef std::vector< Scope > ScopeList;
     
    219210        }
    220211
    221         // Starts a new scope with the given note
    222         template<typename N>
    223         void beginScope( N&& n ) {
    224                 scopes.emplace_back( std::forward<N>(n) );
    225         }
    226 
    227212        /// Ends a scope; invalidates any iterators pointing to elements of that scope
    228213        void endScope() {
     
    232217
    233218        /// Default constructor initializes with one scope
    234         ScopedMap() : scopes() { beginScope(); }
    235 
    236         /// Constructs with a given note on the outermost scope
    237         template<typename N>
    238         ScopedMap( N&& n ) : scopes() { beginScope(std::forward<N>(n)); }
     219        ScopedMap() { beginScope(); }
    239220
    240221        iterator begin() { return iterator(scopes, scopes.back().map.begin(), currentScope()).next_valid(); }
  • src/Parser/TypedefTable.cc

    r046959b r242f705  
    9191
    9292void TypedefTable::enterScope() {
    93         kindTable.beginScope(0);
     93        kindTable.beginScope();
    9494        debugPrint( cerr << "Entering scope " << kindTable.currentScope() << endl; print() );
    9595} // TypedefTable::enterScope
  • src/Parser/TypedefTable.h

    r046959b r242f705  
    2525        typedef ScopedMap< std::string, int, int > KindTable;
    2626        KindTable kindTable;   
    27         unsigned int level;
     27        unsigned int level = 0;
    2828  public:
    29     TypedefTable() : kindTable{0}, level{0} {}
    3029        ~TypedefTable();
    3130
Note: See TracChangeset for help on using the changeset viewer.