-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent empty data tokens in fb spines
- Loading branch information
1 parent
1d626d8
commit 874e308
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Fr 8 Dez 2023 00:13:22 CET | ||
// Last Modified: Fr 8 Dez 2023 12:36:58 CET | ||
// Filename: min/humlib.cpp | ||
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.cpp | ||
// Syntax: C++11 | ||
|
@@ -101949,6 +101949,17 @@ string Tool_musicxml2hum::getFiguredBassString(xml_node fnode) { | |
} | ||
} | ||
|
||
output = std::regex_replace(output, std::regex("^ +| +$|( ) +"), "$1"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
WolfgangDrescher
Author
Contributor
|
||
|
||
if (output.empty()) { | ||
if (children.size()) { | ||
cerr << "WARNING: figured bass string is empty but has " | ||
<< children.size() << " figure elements as children. " | ||
<< "The output has been replaced with \".\"" << endl; | ||
} | ||
output = "."; | ||
} | ||
|
||
return output; | ||
|
||
// HTp fbtok = new HumdrumToken(fbstring); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Fr 8 Dez 2023 00:13:22 CET | ||
// Last Modified: Fr 8 Dez 2023 12:36:58 CET | ||
// Filename: min/humlib.h | ||
// URL: https://github.com/craigsapp/humlib/blob/master/min/humlib.h | ||
// Syntax: C++11 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ideally this would be:
Or regex could use
to make it easier to read the spaces:
\\s
instead ofOr using a literal string to not need to escape the backslashes:
R"(^\s+|\s+$|(\s)\s+)"
I don't understand the regular expression in any case:
$1
would only be a space in the case( ) +
, and empty in the first two cases. So I am wondering what this line does?