Changeset 653 for CMT


Ignore:
Timestamp:
Nov 7, 2013, 4:04:42 PM (11 years ago)
Author:
rybkin
Message:

See C.L. 512

Location:
CMT/HEAD
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r652 r653  
     12013-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       
    1192013-11-05    <rybkin@lal.in2p3.fr> 511
    220
  • CMT/HEAD/source/cmt.h

    r652 r653  
    2424
    2525  void clear ();
     26  int initialize ();
    2627
    2728  ActionType m_action;
     
    233234  static const cmt_string& get_current_version ();
    234235  static const cmt_string& get_current_target ();
     236  static const CmtSystem::cmt_string_vector& get_tags_remove ();
    235237  static bool get_debug ();
    236238  static bool get_disable_warnings (); 
  • CMT/HEAD/source/cmt_parser.cxx

    r652 r653  
    4949{
    5050  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//----------------------------------------------------------
    7154CmtContext::~CmtContext ()
    7255{
    7356}
    7457
     58//----------------------------------------------------------
    7559void CmtContext::clear ()
    7660{
     
    126110  m_autoconfigure_cmtpath = false;
    127111}
    128 
     112//----------------------------------------------------------
     113
     114int 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}
    129138//----------------------------------------------------------
    130139
     
    550559  log << "configure_default_path" << log_endl;
    551560  configure_default_path ();
     561
     562  log << "restore_all_tags" << log_endl;
     563  restore_all_tags (0);
    552564  log << "configure_version_tag" << log_endl;
    553565  configure_version_tag ();
     
    54865498{
    54875499  return (Me.m_current_target);
     5500}
     5501
     5502const CmtSystem::cmt_string_vector& Cmt::get_tags_remove ()
     5503{
     5504  return (Me.m_tags_remove);
    54885505}
    54895506
     
    67476764int Cmt::parser (int argc, char* argv[])
    67486765{
     6766  // save CMTFLAGS
     6767  cmt_string cmtflags (get_cmt_flags ());
     6768
     6769  clear ();
     6770  Me.initialize ();
     6771
    67496772  ArgParser ap (Me);
    67506773 
     
    67596782    }
    67606783
    6761   // save CMTFLAGS
    6762   cmt_string cmtflags (get_cmt_flags ());
    6763 
    6764   clear ();
     6784  //  clear ();
    67656785
    67666786  //  Me.clear ();
     
    67776797    default:
    67786798      configure (ap);
    6779       restore_all_tags (0);
     6799      //restore_all_tags (0);
    67806800      break;
    67816801    }
  • CMT/HEAD/source/cmt_syntax.cxx

    r652 r653  
    290290          {
    291291            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");
    294299          }
    295300      }
     
    11331138          {
    11341139            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");
    11371147          }
    11381148      }
     
    12421252          {
    12431253            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");
    12461261          }
    12471262      }
     
    20652080
    20662081  keyword->action (words, project, file_name, line_number);
     2082
     2083  if (CmtError::get_last_error_code () == CmtError::syntax_error)
     2084    CmtError::print ();
    20672085}
  • CMT/HEAD/source/cmt_tag.cxx

    r568 r653  
    9999
    100100  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;
    101105
    102106  if (m_tag_excludes.size () > 0)
Note: See TracChangeset for help on using the changeset viewer.