Changeset 509
- Timestamp:
- Dec 8, 2007, 10:42:07 PM (15 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Configuration.cc
r508 r509 153 153 } 154 154 } 155 add_codon("*", "", "");156 155 } 157 156 … … 171 170 172 171 173 const std::vector<std::pair<std::string, std::string> > &172 const std::vector<std::pair<std::string, std::string> >* 174 173 Configuration::parse_codon(std::string file_name) const 175 174 { … … 178 177 if (svndigest::equal(file_name.begin(), file_name.end(), 179 178 i->first.begin(), i->first.end()) ) { 180 return i->second;179 return &i->second; 181 180 } 182 181 } 183 return string2codons_.back().second;182 return NULL; 184 183 } 185 184 … … 304 303 os << "trac-root = " << conf.trac_root() << "\n"; 305 304 306 if ( conf.string2codons_.size()>1) {305 if (!conf.string2codons_.empty()) { 307 306 os << "\n" 308 307 << "### Section for setting parsing modes\n" … … 313 312 << "### String \"<NEWLINE>\" can be used for codons containing newline" 314 313 << "\n### character: '\\n'\n" 315 << "[parsing]\n"; 316 for (size_t i=0; i<conf.string2codons_.size()-1; ++i) 317 for (size_t j=0; j<conf.string2codons_[i].second.size(); ++j) 318 os << conf.string2codons_[i].first << " = " 319 << trans_beg_code(conf.string2codons_[i].second[j].first) 314 << "[parsing-codons]\n"; 315 for (size_t i=0; i<conf.string2codons_.size(); ++i) { 316 os << conf.string2codons_[i].first << " = "; 317 for (size_t j=0; j<conf.string2codons_[i].second.size(); ++j) { 318 if (j) 319 os << " ; "; 320 os << trans_beg_code(conf.string2codons_[i].second[j].first) 320 321 << " : " 321 << trans_end_code(conf.string2codons_[i].second[j].second) 322 << "\n"; 322 << trans_end_code(conf.string2codons_[i].second[j].second); 323 } 324 os << "\n"; 325 } 323 326 } 324 325 327 return os; 326 328 } -
trunk/lib/Configuration.h
r508 r509 70 70 \return vector of parse codons for the given \a file_name 71 71 */ 72 const std::vector<std::pair<std::string, std::string> > &72 const std::vector<std::pair<std::string, std::string> >* 73 73 parse_codon(std::string file_name) const; 74 74
Note: See TracChangeset
for help on using the changeset viewer.