Changeset 283 for CMT


Ignore:
Timestamp:
Oct 24, 2006, 3:03:22 PM (18 years ago)
Author:
arnault
Message:

New keyword cmtpath_pattern_revert - See CL 318

Location:
CMT/HEAD/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_cmtpath_pattern.cxx

    r11 r283  
    1515//----------------------------------------------------------
    1616
    17 void CmtPathPattern::action (const CmtSystem::cmt_string_vector& words, Use* use)
     17void CmtPathPattern::action (const CmtSystem::cmt_string_vector& words, Use* use, bool revert)
    1818{
    1919  if (words.size () < 1) return;
     
    3030    //
    3131
    32   add (words, use);
     32  add (words, use, revert);
    3333
    3434  if (Cmt::get_debug ())
     
    3838}
    3939
    40 void CmtPathPattern::add (const CmtSystem::cmt_string_vector& words, Use* use)
     40void CmtPathPattern::add (const CmtSystem::cmt_string_vector& words, Use* use, bool revert)
    4141{
    4242  static CmtPathPatternVector& CmtPathPatterns = patterns ();
     
    4747
    4848  p.use  = use;
     49  p.revert  = revert;
    4950
    5051  int first_word = 1;
     
    252253      CmtPathPatternProjectAction pa (*this, current_use);
    253254
    254       Project::reverse_broadcast (pa);
     255      if (revert)
     256        {
     257          Project::broadcast (pa);
     258        }
     259      else
     260        {
     261          Project::reverse_broadcast (pa);
     262        }
    255263    }
    256264}
  • CMT/HEAD/source/cmt_cmtpath_pattern.h

    r11 r283  
    1616  typedef cmt_vector<CmtPathPattern*> CmtPathPatternPtrVector;
    1717
    18   static void action (const CmtSystem::cmt_string_vector& words, Use* use);
     18  static void action (const CmtSystem::cmt_string_vector& words, Use* use, bool revert = false);
    1919
    20   static void add (const CmtSystem::cmt_string_vector& words, Use* use);
     20  static void add (const CmtSystem::cmt_string_vector& words, Use* use, bool revert);
    2121
    2222  static int pattern_number ();
     
    3838  cmt_string line;
    3939  Use* use;
     40  bool revert;
    4041};
    4142
  • CMT/HEAD/source/cmt_parser.cxx

    r282 r283  
    69916991            buffer += "\" ";
    69926992          }
    6993        
     6993
    69946994        for (int include_number = 0;
    69956995             include_number < use.includes.size ();
  • CMT/HEAD/source/cmt_syntax.cxx

    r280 r283  
    289289  {}
    290290
     291};
     292
     293class KwdCmtPathPatternRevert : public Kwd
     294{
     295public:
     296  void action (const CmtSystem::cmt_string_vector& words,
     297               Use* use,
     298               const cmt_string& /*file_name*/,
     299               int /*line_number*/)
     300  {
     301    CmtPathPattern::action (words, use, true);
     302  }
     303
     304  void action (const CmtSystem::cmt_string_vector& words,
     305                  Project* project,
     306                  const cmt_string& file_name,
     307                  int line_number)
     308  {}
    291309};
    292310
     
    13751393  m_keywords.add ("cleanup_script", new KwdCleanupScript ());
    13761394  m_keywords.add ("cmtpath_pattern", new KwdCmtPathPattern ());
     1395  m_keywords.add ("cmtpath_pattern_revert", new KwdCmtPathPatternRevert ());
    13771396  m_keywords.add ("document", new KwdDocument ());
    13781397  m_keywords.add ("end_private", new KwdEndPrivate ());
Note: See TracChangeset for help on using the changeset viewer.