Changeset 736 in dev for trunk/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp
- Timestamp:
- Aug 25, 2008, 5:38:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/Symbol.cpp
r632 r736 5 5 const NamespaceSupporter *Symbol::namespaceSupporter = NULL; 6 6 7 char *calcNames[256] = {8 "xor",7 char const *calcNames[256] = { 8 0, 9 9 }; 10 10 void InitCalcNames() … … 14 14 return; 15 15 } 16 17 memset( calcNames, 0, 255 * sizeof(char *) );18 16 calcNames[CALC_XOR] = "xor"; 19 17 calcNames[CALC_OR] = "or"; … … 106 104 if( namespaceScopes.size() ) 107 105 { 108 return namespaceScopes.ToString() + "."+ name;106 return namespaceScopes.ToString() + '.' + name; 109 107 } 110 108 … … 123 121 bool Symbol::IsEqualSymbol( const Symbol &symbol ) const 124 122 { 125 if( IsEqualSymbol( symbol.GetNamespaceScopes(), symbol.GetName() ) ) 123 const NamespaceScopes &symbolNS = symbol.GetNamespaceScopes(); 124 if( IsEqualSymbol( symbolNS, symbol.GetName() ) ) 126 125 { 127 126 return true; 128 127 } 129 128 130 if( symbol.GetNamespaceScopes().size() >= 1)129 if( !symbolNS.empty() ) 131 130 { 132 131 // 静的メンバを考慮 133 NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes());134 std::string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName();135 namespaceScopes.pop_back();136 137 return IsEqualSymbol( namespaceScopes, name );132 std::string name = symbolNS.back() + '.' + symbol.GetName(); 133 if( GetName() != name ){ 134 return false; 135 } 136 return IsEqualSymbol( NamespaceScopes( symbolNS.begin(), symbolNS.end() - 1 ), name ); 138 137 } 139 138 return false;
Note:
See TracChangeset
for help on using the changeset viewer.