@@ -49,7 +49,8 @@ NameSpace::~NameSpace()
49
49
void NameSpace::addSymbol (Symbol* pSymbol)
50
50
{
51
51
poco_check_ptr (pSymbol);
52
-
52
+
53
+ pSymbol->setOrder (_symbols.size ());
53
54
_symbols.insert (SymbolTable::value_type (pSymbol->name (), pSymbol));
54
55
}
55
56
@@ -65,7 +66,7 @@ void NameSpace::importSymbol(const std::string& fullName)
65
66
}
66
67
}
67
68
68
-
69
+
69
70
void NameSpace::importNameSpace (const std::string& nameSpace)
70
71
{
71
72
_importedNameSpaces.push_back (nameSpace);
@@ -94,7 +95,7 @@ Symbol* NameSpace::lookup(const std::string& name) const
94
95
Symbol* NameSpace::lookup (const std::string& name, std::set<const NameSpace*>& alreadyVisited) const
95
96
{
96
97
Symbol* pSymbol = 0 ;
97
-
98
+
98
99
if (name.empty ())
99
100
return pSymbol;
100
101
@@ -104,11 +105,11 @@ Symbol* NameSpace::lookup(const std::string& name, std::set<const NameSpace*>& a
104
105
std::string head;
105
106
std::string tail;
106
107
splitName (name, head, tail);
107
-
108
+
108
109
alreadyVisited.insert (this );
109
110
bool currentNSInserted = true ;
110
111
111
- if (head.empty ())
112
+ if (head.empty ())
112
113
{
113
114
alreadyVisited.insert (this );
114
115
return root ()->lookup (tail, alreadyVisited);
@@ -161,13 +162,13 @@ void NameSpace::nameSpaces(SymbolTable& table) const
161
162
extract (Symbol::SYM_NAMESPACE, table);
162
163
}
163
164
164
-
165
+
165
166
void NameSpace::typeDefs (SymbolTable& table) const
166
167
{
167
168
extract (Symbol::SYM_TYPEDEF, table);
168
169
}
169
170
170
-
171
+
171
172
void NameSpace::typeAliases (SymbolTable& table) const
172
173
{
173
174
extract (Symbol::SYM_TYPEALIAS, table);
@@ -179,19 +180,19 @@ void NameSpace::enums(SymbolTable& table) const
179
180
extract (Symbol::SYM_ENUM, table);
180
181
}
181
182
182
-
183
+
183
184
void NameSpace::classes (SymbolTable& table) const
184
185
{
185
186
extract (Symbol::SYM_STRUCT, table);
186
187
}
187
188
188
-
189
+
189
190
void NameSpace::functions (SymbolTable& table) const
190
191
{
191
192
extract (Symbol::SYM_FUNCTION, table);
192
193
}
193
194
194
-
195
+
195
196
void NameSpace::variables (SymbolTable& table) const
196
197
{
197
198
extract (Symbol::SYM_VARIABLE, table);
@@ -226,7 +227,7 @@ void NameSpace::splitName(const std::string& name, std::string& head, std::strin
226
227
head.assign (name, 0 , pos);
227
228
pos += 2 ;
228
229
poco_assert (pos < name.length ());
229
- tail.assign (name, pos, name.length () - pos);
230
+ tail.assign (name, pos, name.length () - pos);
230
231
}
231
232
else head = name;
232
233
}
0 commit comments