Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shed] Fix issues with multiple expressions #102

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/tool-shed.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Tool_shed : public HumTool {

protected:
void processFile (HumdrumFile& infile);
void processExpression (HumdrumFile& infile);
void searchAndReplaceInterpretation (HumdrumFile& infile);
void searchAndReplaceExinterp (HumdrumFile& infile);
void searchAndReplaceData (HumdrumFile& infile);
Expand Down
25 changes: 17 additions & 8 deletions min/humlib.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Thu Nov 14 07:42:35 PST 2024
// Last Modified: Do 21 Nov 2024 21:59:25 CET
// Filename: min/humlib.cpp
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.cpp
// Syntax: C++11
Expand Down Expand Up @@ -126363,10 +126363,7 @@ bool Tool_shed::run(HumdrumFile& infile) {
cerr << "Error: -e option is required" << endl;
return false;
}
for (int i=0; i<(int)m_options.size(); i++) {
prepareSearch(i);
processFile(infile);
}
processFile(infile);
return true;
}

Expand Down Expand Up @@ -126658,6 +126655,21 @@ vector<string> Tool_shed::addToExInterpList(void) {
//

void Tool_shed::processFile(HumdrumFile& infile) {
for (int i=0; i<(int)m_options.size(); i++) {
prepareSearch(i);
processExpression(infile);
}
m_humdrum_text << infile;
}



//////////////////////////////
//
// Tool_shed::processExpression --
//

void Tool_shed::processExpression(HumdrumFile& infile) {
if (m_search == "") {
// nothing to do
return;
Expand Down Expand Up @@ -126703,9 +126715,6 @@ void Tool_shed::processFile(HumdrumFile& infile) {
if (m_modified) {
infile.createLinesFromTokens();
}

// needed only for command-line version of tool?:
m_humdrum_text << infile;
}


Expand Down
3 changes: 2 additions & 1 deletion min/humlib.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Programmer: Craig Stuart Sapp <[email protected]>
// Creation Date: Sat Aug 8 12:24:49 PDT 2015
// Last Modified: Thu Nov 14 07:42:35 PST 2024
// Last Modified: Do 21 Nov 2024 21:59:25 CET
// Filename: min/humlib.h
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.h
// Syntax: C++11
Expand Down Expand Up @@ -10856,6 +10856,7 @@ class Tool_shed : public HumTool {

protected:
void processFile (HumdrumFile& infile);
void processExpression (HumdrumFile& infile);
void searchAndReplaceInterpretation (HumdrumFile& infile);
void searchAndReplaceExinterp (HumdrumFile& infile);
void searchAndReplaceData (HumdrumFile& infile);
Expand Down
23 changes: 16 additions & 7 deletions src/tool-shed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ bool Tool_shed::run(HumdrumFile& infile) {
cerr << "Error: -e option is required" << endl;
return false;
}
for (int i=0; i<(int)m_options.size(); i++) {
prepareSearch(i);
processFile(infile);
}
processFile(infile);
return true;
}

Expand Down Expand Up @@ -378,6 +375,21 @@ vector<string> Tool_shed::addToExInterpList(void) {
//

void Tool_shed::processFile(HumdrumFile& infile) {
for (int i=0; i<(int)m_options.size(); i++) {
prepareSearch(i);
processExpression(infile);
}
m_humdrum_text << infile;
}



//////////////////////////////
//
// Tool_shed::processExpression --
//

void Tool_shed::processExpression(HumdrumFile& infile) {
if (m_search == "") {
// nothing to do
return;
Expand Down Expand Up @@ -423,9 +435,6 @@ void Tool_shed::processFile(HumdrumFile& infile) {
if (m_modified) {
infile.createLinesFromTokens();
}

// needed only for command-line version of tool?:
m_humdrum_text << infile;
}


Expand Down