Skip to content

Commit

Permalink
LIB: ignore extra spaces surrounding '=' in sfz files
Browse files Browse the repository at this point in the history
Fixes #40.

Signed-off-by: Stefan Westerfeld <[email protected]>
  • Loading branch information
swesterfeld committed Jul 11, 2023
1 parent 1ea6b91 commit f466034
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ Loader::parse (const string& filename, SampleCache& sample_cache)

static const regex space_re ("\\s+(.*)");
static const regex tag_re ("<([^>]*)>(.*)");
static const regex key_val_re ("([a-z0-9_]+)=(\\S+)(.*)");
static const regex key_val_re ("([a-z0-9_]+)\\s*=\\s*(\\S+)(.*)");
for (auto line_info : lines)
{
current_line_info = line_info; // for error location reporting
Expand All @@ -1143,9 +1143,9 @@ Loader::parse (const string& filename, SampleCache& sample_cache)
* - value is followed by <tag>
* - value is followed by another opcode (foo=bar)
*/
static const regex key_val_space_re_eol ("([a-z0-9_]+)=([^=<]+)");
static const regex key_val_space_re_tag ("([a-z0-9_]+)=([^=<]+)(<.*)");
static const regex key_val_space_re_eq ("([a-z0-9_]+)=([^=<]+)(\\s[a-z0-9_]+=.*)");
static const regex key_val_space_re_eol ("([a-z0-9_]+)\\s*=([^=<]+)");
static const regex key_val_space_re_tag ("([a-z0-9_]+)\\s*=([^=<]+)(<.*)");
static const regex key_val_space_re_eq ("([a-z0-9_]+)\\s*=([^=<]+)(\\s[a-z0-9_]+\\s*=.*)");

if (regex_match (l, sm, key_val_space_re_eol))
{
Expand Down

0 comments on commit f466034

Please sign in to comment.