better parsing and readme

This commit is contained in:
Alex Moening 2026-06-30 15:32:39 -04:00
parent 1e0bb72827
commit cdd9d00a76
2 changed files with 13 additions and 2 deletions

View file

@ -2,7 +2,7 @@
MossMan is a tool designed to ease the filtering, viewing, and compilation of [Stanford MOSS](https://theory.stanford.edu/~aiken/moss/) reports. It is specialized for CMU's 15-122 programing course, generating the outline of a file that is read by another script. It could be used for other courses however. MossMan is a tool designed to ease the filtering, viewing, and compilation of [Stanford MOSS](https://theory.stanford.edu/~aiken/moss/) reports. It is specialized for CMU's 15-122 programing course, generating the outline of a file that is read by another script. It could be used for other courses however.
![Screenshot](https://ajm.onl/moss.png)
## Adding images ## Adding images

View file

@ -134,14 +134,24 @@ void LoadReport(std::string s, Fl_Text_Buffer * text, Fl_Text_Buffer * style) {
std::regex endcolorpatt("</FONT>(.*)"); std::regex endcolorpatt("</FONT>(.*)");
size_t count = 0;
while (std::getline(stream, line)) { while (std::getline(stream, line)) {
if (count < 7) {
count++;
continue;
}
if (line == "</PRE>" || line == "</BODY>" || line == "</HTML>") {
count++;
continue;
}
std::smatch matches; std::smatch matches;
std::string formatted = htmlCodesToNormal(line); std::string formatted = htmlCodesToNormal(line);
if(std::regex_search(formatted, matches, startcolorpatt)) { if(std::regex_search(formatted, matches, startcolorpatt)) {
//std::cout << v << std::endl; //std::cout << v << std::endl;
currentval = NumberToStyle(std::stoi(matches[1])); currentval = NumberToStyle(std::stoi(matches[1]));
count++;
continue; continue;
} }
@ -158,6 +168,7 @@ void LoadReport(std::string s, Fl_Text_Buffer * text, Fl_Text_Buffer * style) {
for (size_t i = 0; i < formatted.length()+1; i++) { for (size_t i = 0; i < formatted.length()+1; i++) {
style->append(currentval.c_str()); style->append(currentval.c_str());
} }
count++;
} }