Changeset 653
- Timestamp:
- Nov 7, 2013, 4:04:42 PM (11 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r652 r653 1 2013-11-07 <rybkin@lal.in2p3.fr> 512 2 3 * source/cmt_tag.cxx: In class Tag mark function, do not activate tag if 4 in list of tags to remove, making -tag_remove=<tag-list> option functional 5 on any tags (rather than only those specified on the command line or in 6 CMTEXTRATAGS environment variable) 7 * source/cmt_syntax.cxx: In classes KwdBuildStrategy, KwdSetupStrategy, 8 KwdStructureStrategy action project function, make error description 9 detailed, in class SyntaxParser do_parse_words project function, print 10 error message in case of syntax error encountered in value 11 * source/cmt_parser.cxx: In class CmtContext, factor out processing of 12 CMTEXTRATAGS environment variable value into separate initialize function, 13 in class Cmt, move restore_all_tags call into configure function before all 14 system tags handling to make all initially known tags available while 15 reading project files, implement get_tags_remove function, in parser 16 function initialise static xCmtContext instance at very beginning 17 * source/cmt.h: In class Cmt, declare get_tags_remove function 18 1 19 2013-11-05 <rybkin@lal.in2p3.fr> 511 2 20 -
CMT/HEAD/source/cmt.h
r652 r653 24 24 25 25 void clear (); 26 int initialize (); 26 27 27 28 ActionType m_action; … … 233 234 static const cmt_string& get_current_version (); 234 235 static const cmt_string& get_current_target (); 236 static const CmtSystem::cmt_string_vector& get_tags_remove (); 235 237 static bool get_debug (); 236 238 static bool get_disable_warnings (); -
CMT/HEAD/source/cmt_parser.cxx
r652 r653 49 49 { 50 50 clear (); 51 52 cmt_string tags = CmtSystem::getenv ("CMTEXTRATAGS"); 53 CmtSystem::cmt_string_vector words; 54 CmtSystem::split (tags, " \t,", words); 55 for (int i = 0; i < words.size (); i++) 56 { 57 bool has (false); 58 for (int j = 0; j < m_extra_tags.size (); j++) 59 { 60 if (m_extra_tags[j] == words[i]) 61 { 62 has = true; 63 break; 64 } 65 } 66 if (!has) 67 m_extra_tags.push_back (words[i]); 68 } 69 } 70 51 } 52 53 //---------------------------------------------------------- 71 54 CmtContext::~CmtContext () 72 55 { 73 56 } 74 57 58 //---------------------------------------------------------- 75 59 void CmtContext::clear () 76 60 { … … 126 110 m_autoconfigure_cmtpath = false; 127 111 } 128 112 //---------------------------------------------------------- 113 114 int CmtContext::initialize () 115 { 116 int errors (0); 117 118 cmt_string tags = CmtSystem::getenv ("CMTEXTRATAGS"); 119 CmtSystem::cmt_string_vector words; 120 CmtSystem::split (tags, " \t,", words); 121 for (int i = 0; i < words.size (); i++) 122 { 123 bool has (false); 124 for (int j = 0; j < m_extra_tags.size (); j++) 125 { 126 if (m_extra_tags[j] == words[i]) 127 { 128 has = true; 129 break; 130 } 131 } 132 if (!has) 133 m_extra_tags.push_back (words[i]); 134 } 135 136 return - errors; 137 } 129 138 //---------------------------------------------------------- 130 139 … … 550 559 log << "configure_default_path" << log_endl; 551 560 configure_default_path (); 561 562 log << "restore_all_tags" << log_endl; 563 restore_all_tags (0); 552 564 log << "configure_version_tag" << log_endl; 553 565 configure_version_tag (); … … 5486 5498 { 5487 5499 return (Me.m_current_target); 5500 } 5501 5502 const CmtSystem::cmt_string_vector& Cmt::get_tags_remove () 5503 { 5504 return (Me.m_tags_remove); 5488 5505 } 5489 5506 … … 6747 6764 int Cmt::parser (int argc, char* argv[]) 6748 6765 { 6766 // save CMTFLAGS 6767 cmt_string cmtflags (get_cmt_flags ()); 6768 6769 clear (); 6770 Me.initialize (); 6771 6749 6772 ArgParser ap (Me); 6750 6773 … … 6759 6782 } 6760 6783 6761 // save CMTFLAGS 6762 cmt_string cmtflags (get_cmt_flags ()); 6763 6764 clear (); 6784 // clear (); 6765 6785 6766 6786 // Me.clear (); … … 6777 6797 default: 6778 6798 configure (ap); 6779 restore_all_tags (0);6799 //restore_all_tags (0); 6780 6800 break; 6781 6801 } -
CMT/HEAD/source/cmt_syntax.cxx
r652 r653 290 290 { 291 291 in_error = true; 292 293 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 292 char num[32]; sprintf (num, "%d", line_number); 293 CmtError::set (CmtError::syntax_error, 294 project->get_name () 295 + " project file: " + file_name 296 + ": line: " + num 297 + ": " + value + ": Bad strategy value"); 298 //CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 294 299 } 295 300 } … … 1133 1138 { 1134 1139 in_error = true; 1135 1136 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 1140 char num[32]; sprintf (num, "%d", line_number); 1141 CmtError::set (CmtError::syntax_error, 1142 project->get_name () 1143 + " project file: " + file_name 1144 + ": line: " + num 1145 + ": " + value + ": Bad strategy value"); 1146 //CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 1137 1147 } 1138 1148 } … … 1242 1252 { 1243 1253 in_error = true; 1244 1245 CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 1254 char num[32]; sprintf (num, "%d", line_number); 1255 CmtError::set (CmtError::syntax_error, 1256 project->get_name () 1257 + " project file: " + file_name 1258 + ": line: " + num 1259 + ": " + value + ": Bad strategy value"); 1260 //CmtError::set (CmtError::syntax_error, "ParseRequirements> bad strategy keyword"); 1246 1261 } 1247 1262 } … … 2065 2080 2066 2081 keyword->action (words, project, file_name, line_number); 2082 2083 if (CmtError::get_last_error_code () == CmtError::syntax_error) 2084 CmtError::print (); 2067 2085 } -
CMT/HEAD/source/cmt_tag.cxx
r568 r653 99 99 100 100 Log; 101 102 const CmtSystem::cmt_string_vector& tags_remove = Cmt::get_tags_remove (); 103 for (int i = tags_remove.size () - 1; i >= 0; i--) 104 if (tags_remove[i] == m_name) return; 101 105 102 106 if (m_tag_excludes.size () > 0)
Note: See TracChangeset
for help on using the changeset viewer.