Changeset 218
- Timestamp:
- Oct 1, 2006, 10:17:47 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Parser.cc
r217 r218 42 42 match_end(path.rbegin(), path.rend(), ".pl") || 43 43 match_end(path.rbegin(), path.rend(), ".pm") || 44 match_end(path.rbegin(), path.rend(), ".sh")) 44 match_end(path.rbegin(), path.rend(), ".sh") || 45 file_name(path)=="Makefile") 45 46 line_com_mode(is, "#"); 46 47 else if (match_end(path.rbegin(), path.rend(), ".tex")) 47 48 line_com_mode(is, "%"); 49 else if (match_end(path.rbegin(), path.rend(), ".txt") || 50 file_name(path)=="AUTHORS" || 51 file_name(path)=="ChangeLog" || 52 file_name(path)=="INSTALL" || 53 file_name(path)=="NEWS" || 54 file_name(path)=="README") 55 text_mode(is); 48 56 else 49 57 cc_mode(is); … … 133 141 134 142 143 void Parser::text_mode(std::istream& is) 144 { 145 std::string str; 146 while(getline(is,str)) { 147 line_type lt=empty; 148 for (std::string::iterator iter=str.begin(); iter!=str.end(); ++iter){ 149 if (lt==empty && isalnum(*iter)) 150 lt = comment; 151 } 152 type_.push_back(lt); 153 } 154 } 155 156 135 157 }} // end of namespace svndigest and namespace theplu -
trunk/lib/Parser.h
r214 r218 72 72 void line_com_mode(std::istream& is, const std::string& com_start); 73 73 74 void text_mode(std::istream&); 75 74 76 std::vector<line_type> type_; 75 77 -
trunk/test/parser.cc
r217 r218 35 35 ok = ok && test("parser.cc",os); 36 36 ok = ok && test("Makefile.am",os); 37 ok = ok && test("../INSTALL",os); 37 38 return 0; 38 39 }
Note: See TracChangeset
for help on using the changeset viewer.