- Timestamp:
- Apr 20, 2007, 12:50:46 PM (17 years ago)
- Location:
- CMT/HEAD/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/source/cmt_deps_builder.cxx
r397 r399 121 121 char term = 0; 122 122 // To ignore leading spaces and tabs 123 while ( (*ptr == ' ') || (*ptr == '\ \t'))123 while ( (*ptr == ' ') || (*ptr == '\t')) 124 124 { 125 125 ptr++; … … 131 131 132 132 // skip spaces 133 while ((*ptr == ' ') || (*ptr == '\ \t')) ptr++;133 while ((*ptr == ' ') || (*ptr == '\t')) ptr++; 134 134 135 135 if (!strncmp (ptr, "include", 7)) … … 139 139 ptr += 7; 140 140 141 while ((*ptr == ' ') || (*ptr == '\ \t')) ptr++;141 while ((*ptr == ' ') || (*ptr == '\t')) ptr++; 142 142 143 143 if (*ptr == '<') … … 174 174 ptr += 13; 175 175 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 = '\''; 181 181 ptr++; 182 182 } … … 187 187 } 188 188 } 189 else if (!strncmp (ptr, "\ \tinclude", 8))189 else if (!strncmp (ptr, "\tinclude", 8)) 190 190 { 191 191 // fortran include statement … … 193 193 ptr += 8; 194 194 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 = '\''; 200 200 ptr++; 201 201 } … … 256 256 {single-quote double-quote open-comment open-line-comment} 257 257 258 Must exclude escaped quotes \ \' and \\"258 Must exclude escaped quotes \' and \" 259 259 */ 260 260 261 261 char* pos = strchr (ptr, '"'); 262 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\ \\'))262 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\')) 263 263 { 264 264 state = in_string; … … 267 267 } 268 268 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) != '\\')) 271 271 { 272 272 state = in_char; … … 311 311 else 312 312 { 313 if ((pos > ptr) && (*(pos - 1) == '\\ \\'))313 if ((pos > ptr) && (*(pos - 1) == '\\')) 314 314 { 315 315 ptr = pos + 1; … … 330 330 // we exclusively look for a single quote 331 331 332 char* pos = strchr (ptr, '\ \'');332 char* pos = strchr (ptr, '\''); 333 333 if (pos == 0) 334 334 { … … 340 340 else 341 341 { 342 if ((pos > ptr) && (*(pos - 1) == '\\ \\'))342 if ((pos > ptr) && (*(pos - 1) == '\\')) 343 343 { 344 344 ptr = pos + 1; … … 368 368 pos = strchr (ptr, '"'); 369 369 370 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\ \\'))370 if ((pos != 0) && (pos < pattern) && (pos > ptr) && (*(pos-1) != '\\')) 371 371 { 372 372 state = in_string_comment; … … 375 375 } 376 376 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) != '\\')) 379 379 { 380 380 state = in_char_comment; … … 408 408 else 409 409 { 410 if ((pos > ptr) && (*(pos - 1) == '\\ \\'))410 if ((pos > ptr) && (*(pos - 1) == '\\')) 411 411 { 412 412 ptr = pos + 1; … … 425 425 static char* in_char_comment_action (char* ptr, state_def& state) 426 426 { 427 char* pos = strchr (ptr, '\ \'');427 char* pos = strchr (ptr, '\''); 428 428 if (pos == 0) 429 429 { … … 434 434 else 435 435 { 436 if ((pos > ptr) && (*(pos - 1) == '\\ \\'))436 if ((pos > ptr) && (*(pos - 1) == '\\')) 437 437 { 438 438 ptr = pos + 1; … … 452 452 static char* in_line_comment_action (char* ptr, state_def& state) 453 453 { 454 char * pos = strchr (ptr, '\\ \\');454 char * pos = strchr (ptr, '\\'); 455 455 /* Extend this part to deal with continuation character */ 456 456 if ( (pos == NULL) || ( (ptr + strlen(ptr)-1)!=pos )) … … 491 491 { 492 492 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"); 495 495 496 496 if ( (crnl==0) && (nl ==0)) break; … … 538 538 char* marker_pos = 0; 539 539 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'); 542 542 543 543 char* first = nl; … … 912 912 // 913 913 914 output.replace_all ("\ \n", " ");915 output.replace_all ("\\ \\", " ");914 output.replace_all ("\n", " "); 915 output.replace_all ("\\ ", " "); 916 916 917 917 CmtSystem::cmt_string_vector files; 918 918 919 CmtSystem::split (output, " \ \t", files);919 CmtSystem::split (output, " \t", files); 920 920 921 921 // -
CMT/HEAD/source/cmt_syntax.cxx
r397 r399 269 269 cmt_string s = "build_strategy "; 270 270 s += words[i]; 271 s += "\ \n";271 s += "\n"; 272 272 bool no_found = true; 273 273 int size = project->m_extra_lines.size (); … … 1099 1099 cmt_string s = "setup_strategy "; 1100 1100 s += words[i]; 1101 s += "\ \n";1101 s += "\n"; 1102 1102 bool no_found = true; 1103 1103 int size = project->m_extra_lines.size (); … … 1202 1202 cmt_string s = "structure_strategy "; 1203 1203 s += words[i]; 1204 s += "\ \n";1204 s += "\n"; 1205 1205 bool no_found = true; 1206 1206 int size = project->m_extra_lines.size (); … … 1357 1357 * Parse the input file, rejecting comments and 1358 1358 * rebuilding complete lines (from sections separated by 1359 * \ \characters.1359 * \ characters. 1360 1360 * 1361 1361 * Each reformatted line is parsed by filter_line … … 1396 1396 // { 1397 1397 // 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; 1399 1399 // } 1400 1400 //} … … 1429 1429 bool found = false; 1430 1430 int size = uses.size (); 1431 // cerr << "\ \n size:"<<size<< ":" << endl;1431 // cerr << "\n size:"<<size<< ":" << endl; 1432 1432 for (int n = 0; n < size; n++) 1433 1433 { 1434 1434 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; 1436 1436 if (tuse->get_package_name()==p_use->get_package_name()) 1437 1437 found=true; … … 1462 1462 * Parse a text, rejecting comments and 1463 1463 * rebuilding complete lines (from sections separated by 1464 * \ \characters.1464 * \ characters. 1465 1465 * 1466 1466 * Each reformatted line is parsed by filter_line … … 1654 1654 * Parse a text, rejecting comments and 1655 1655 * rebuilding complete lines (from sections separated by 1656 * \ \characters.1656 * \ characters. 1657 1657 * 1658 1658 * Each reformatted line is parsed by filter_line … … 1681 1681 for (pos = 0; pos < max_pos;) 1682 1682 { 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'); 1685 1685 int first = nl; 1686 1686 int length = 1; … … 1742 1742 if (temp_line[0] == '#') return; 1743 1743 1744 nl = temp_line.find_last_of ('\ \n');1744 nl = temp_line.find_last_of ('\n'); 1745 1745 if (nl != cmt_string::npos) temp_line.erase (nl); 1746 1746 … … 1760 1760 length = temp_line.size (); 1761 1761 1762 back_slash = temp_line.find_last_of ('\\ \\');1762 back_slash = temp_line.find_last_of ('\\'); 1763 1763 1764 1764 if (back_slash != cmt_string::npos) … … 1774 1774 { 1775 1775 char c = temp_line[i]; 1776 if ((c != ' ') && (c != '\ \t'))1776 if ((c != ' ') && (c != '\t')) 1777 1777 { 1778 1778 at_end = false; … … 1808 1808 o Special characters are filtered now : 1809 1809 1810 <cmt:tab/> \ \t1811 <cmt:cr/> \ \r1812 <cmt:lf/> \ \n1810 <cmt:tab/> \t 1811 <cmt:cr/> \r 1812 <cmt:lf/> \n 1813 1813 1814 1814 o Split into words (a word is a string not containing … … 1819 1819 */ 1820 1820 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"); 1824 1824 1825 1825 if (Cmt::get_debug ()) … … 1830 1830 static CmtSystem::cmt_string_vector words; 1831 1831 1832 CmtSystem::split (m_filtered_text, " \ \t", words);1832 CmtSystem::split (m_filtered_text, " \t", words); 1833 1833 1834 1834 if (words.size () != 0)
Note: See TracChangeset
for help on using the changeset viewer.