Changeset 399 for CMT


Ignore:
Timestamp:
Apr 20, 2007, 12:50:46 PM (17 years ago)
Author:
garonne
Message:

correct
by \...

Location:
CMT/HEAD/source
Files:
2 edited

Legend:

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

    r397 r399  
    121121  char term = 0;
    122122  // To ignore leading spaces and tabs
    123   while ( (*ptr == ' ') || (*ptr == '\\t'))
     123  while ( (*ptr == ' ') || (*ptr == '\t'))
    124124  {
    125125    ptr++;
     
    131131
    132132      // skip spaces
    133       while ((*ptr == ' ') || (*ptr == '\\t')) ptr++;
     133      while ((*ptr == ' ') || (*ptr == '\t')) ptr++;
    134134
    135135      if (!strncmp (ptr, "include", 7))
     
    139139          ptr += 7;
    140140
    141           while ((*ptr == ' ') || (*ptr == '\\t')) ptr++;
     141          while ((*ptr == ' ') || (*ptr == '\t')) ptr++;
    142142         
    143143          if (*ptr == '<')
     
    174174      ptr += 13;
    175175
    176       while ((*ptr == ' ') || (*ptr == '\\t')) ptr++;
    177 
    178       if (*ptr == '\\'')
    179         {
    180           term = '\\'';
     176      while ((*ptr == ' ') || (*ptr == '\t')) ptr++;
     177
     178      if (*ptr == '\'')
     179        {
     180          term = '\'';
    181181          ptr++;
    182182        }
     
    187187        }
    188188    }
    189   else if (!strncmp (ptr, "\\tinclude", 8))
     189  else if (!strncmp (ptr, "\tinclude", 8))
    190190    {
    191191      // fortran include statement
     
    193193      ptr += 8;
    194194
    195       while ((*ptr == ' ') || (*ptr == '\\t')) ptr++;
    196 
    197       if (*ptr == '\\'')
    198         {
    199           term = '\\'';
     195      while ((*ptr == ' ') || (*ptr == '\t')) ptr++;
     196
     197      if (*ptr == '\'')
     198        {
     199          term = '\'';
    200200          ptr++;
    201201        }
     
    256256    {single-quote double-quote open-comment open-line-comment}
    257257
    258     Must exclude escaped quotes \\' and \\"
     258    Must exclude escaped quotes \' and \"
    259259  */
    260260
    261261  char* pos = strchr (ptr, '"');
    262   if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\\\'))
     262  if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))
    263263    {
    264264      state = in_string;
     
    267267    }
    268268
    269   pos = strchr (ptr, '\\'');
    270   if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\\\'))
     269  pos = strchr (ptr, '\'');
     270  if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))
    271271    {
    272272      state = in_char;
     
    311311  else
    312312    {
    313       if ((pos > ptr) && (*(pos - 1) == '\\\\'))
     313      if ((pos > ptr) && (*(pos - 1) == '\\'))
    314314        {
    315315          ptr = pos + 1;
     
    330330  // we exclusively look for a single quote
    331331
    332   char* pos = strchr (ptr, '\\'');
     332  char* pos = strchr (ptr, '\'');
    333333  if (pos == 0)
    334334    {
     
    340340  else
    341341    {
    342       if ((pos > ptr) && (*(pos - 1) == '\\\\'))
     342      if ((pos > ptr) && (*(pos - 1) == '\\'))
    343343        {
    344344          ptr = pos + 1;
     
    368368  pos = strchr (ptr, '"');
    369369 
    370   if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\\\'))
     370  if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))
    371371    {
    372372      state = in_string_comment;
     
    375375    }
    376376
    377   pos = strchr (ptr, '\\'');
    378   if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\\\'))
     377  pos = strchr (ptr, '\'');
     378  if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\'))
    379379    {
    380380      state = in_char_comment;
     
    408408  else
    409409    {
    410       if ((pos > ptr) && (*(pos - 1) == '\\\\'))
     410      if ((pos > ptr) && (*(pos - 1) == '\\'))
    411411        {
    412412          ptr = pos + 1;
     
    425425static char* in_char_comment_action (char* ptr, state_def& state)
    426426{
    427   char* pos = strchr (ptr, '\\'');
     427  char* pos = strchr (ptr, '\'');
    428428  if (pos == 0)
    429429    {
     
    434434  else
    435435    {
    436       if ((pos > ptr) && (*(pos - 1) == '\\\\'))
     436      if ((pos > ptr) && (*(pos - 1) == '\\'))
    437437        {
    438438          ptr = pos + 1;
     
    452452static char* in_line_comment_action (char* ptr, state_def& state)
    453453{
    454   char * pos = strchr (ptr, '\\\\'); 
     454  char * pos = strchr (ptr, '\\'); 
    455455 /* Extend this part to deal with continuation character */ 
    456456  if ( (pos == NULL) || ( (ptr + strlen(ptr)-1)!=pos ))
     
    491491  {
    492492   
    493       char* crnl = strstr (current, "\\\\\\r\\n");
    494       char* nl   = strstr (current, "\\\\\\n");
     493      char* crnl = strstr (current, "/r\n");
     494      char* nl   = strstr (current, "\\\n");
    495495     
    496496      if ( (crnl==0) && (nl ==0)) break;
     
    538538      char* marker_pos = 0;
    539539
    540       char* crnl = strstr (current, "\\r\\n");
    541       char* nl = strchr (current, '\\n');
     540      char* crnl = strstr (current, "\r\n");
     541      char* nl = strchr (current, '\n');
    542542
    543543      char* first = nl;
     
    912912        //
    913913
    914       output.replace_all ("\\n", " ");
    915       output.replace_all ("\\\\ ", " ");
     914      output.replace_all ("\n", " ");
     915      output.replace_all ("\\ ", " ");
    916916     
    917917      CmtSystem::cmt_string_vector files;
    918918     
    919       CmtSystem::split (output, " \\t", files);
     919      CmtSystem::split (output, " \t", files);
    920920
    921921        //
  • CMT/HEAD/source/cmt_syntax.cxx

    r397 r399  
    269269               cmt_string s  = "build_strategy ";
    270270           s             += words[i];
    271            s             += "\\n";           
     271           s             += "\n";           
    272272               bool no_found = true;                     
    273273           int size =  project->m_extra_lines.size ();
     
    10991099        cmt_string s  = "setup_strategy ";
    11001100        s             += words[i];
    1101         s             += "\\n";           
     1101        s             += "\n";           
    11021102        bool no_found = true;                   
    11031103        int size =  project->m_extra_lines.size ();
     
    12021202            cmt_string s  = "structure_strategy ";
    12031203        s             += words[i];
    1204         s             += "\\n";           
     1204        s             += "\n";           
    12051205        bool no_found = true;                   
    12061206        int size =  project->m_extra_lines.size ();
     
    13571357 *  Parse the input file, rejecting comments and
    13581358 * rebuilding complete lines (from sections separated by
    1359  *  \\ characters.
     1359 *  \ characters.
    13601360 *
    13611361 *  Each reformatted line is parsed by filter_line
     
    13961396              //  {
    13971397              //      Use* tuse = use->sub_uses[n];
    1398               //      cerr << "\\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl;         
     1398              //      cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl;         
    13991399              //  }
    14001400              //}
     
    14291429            bool found = false;
    14301430            int  size  = uses.size ();
    1431             // cerr << "\\n size:"<<size<< ":" << endl;     
     1431            // cerr << "\n size:"<<size<< ":" << endl;     
    14321432            for (int n = 0; n < size; n++)
    14331433            {
    14341434                Use* tuse = uses[n];
    1435                 // cerr << "\\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl;                   
     1435                // cerr << "\tpackage file [" << tuse->get_package_name() << "]" <<p_use->get_package_name()<< endl;                   
    14361436                if (tuse->get_package_name()==p_use->get_package_name())
    14371437                   found=true;
     
    14621462 *  Parse a text, rejecting comments and
    14631463 * rebuilding complete lines (from sections separated by
    1464  *  \\ characters.
     1464 *  \ characters.
    14651465 *
    14661466 *  Each reformatted line is parsed by filter_line
     
    16541654 *  Parse a text, rejecting comments and
    16551655 * rebuilding complete lines (from sections separated by
    1656  *  \\ characters.
     1656 *  \ characters.
    16571657 *
    16581658 *  Each reformatted line is parsed by filter_line
     
    16811681  for (pos = 0; pos < max_pos;)
    16821682    {
    1683       int cr = text.find (pos, "\\r\\n");
    1684       int nl = text.find (pos, '\\n');
     1683      int cr = text.find (pos, "\r\n");
     1684      int nl = text.find (pos, '\n');
    16851685      int first = nl;
    16861686      int length = 1;
     
    17421742  if (temp_line[0] == '#') return;
    17431743
    1744   nl = temp_line.find_last_of ('\\n');
     1744  nl = temp_line.find_last_of ('\n');
    17451745  if (nl != cmt_string::npos) temp_line.erase (nl);
    17461746
     
    17601760  length = temp_line.size ();
    17611761
    1762   back_slash = temp_line.find_last_of ('\\\\');
     1762  back_slash = temp_line.find_last_of ('\\');
    17631763
    17641764  if (back_slash != cmt_string::npos)
     
    17741774        {
    17751775          char c = temp_line[i];
    1776           if ((c != ' ') && (c != '\\t'))
     1776          if ((c != ' ') && (c != '\t'))
    17771777            {
    17781778              at_end = false;
     
    18081808    o Special characters are filtered now :
    18091809   
    1810     <cmt:tab/>  \\t
    1811     <cmt:cr/>   \\r
    1812     <cmt:lf/>   \\n
     1810    <cmt:tab/>  \t
     1811    <cmt:cr/>   \r
     1812    <cmt:lf/>   \n
    18131813   
    18141814    o Split into words (a word is a string not containing
     
    18191819  */
    18201820
    1821   m_filtered_text.replace_all ("<cmt:tab/>", "\\t");
    1822   m_filtered_text.replace_all ("<cmt:cr/>",  "\\r");
    1823   m_filtered_text.replace_all ("<cmt:lf/>",  "\\n");
     1821  m_filtered_text.replace_all ("<cmt:tab/>", "\t");
     1822  m_filtered_text.replace_all ("<cmt:cr/>",  "\r");
     1823  m_filtered_text.replace_all ("<cmt:lf/>",  "\n");
    18241824
    18251825  if (Cmt::get_debug ())
     
    18301830  static CmtSystem::cmt_string_vector words;
    18311831 
    1832   CmtSystem::split (m_filtered_text, " \\t", words);
     1832  CmtSystem::split (m_filtered_text, " \t", words);
    18331833 
    18341834  if (words.size () != 0)
Note: See TracChangeset for help on using the changeset viewer.