Emit original string on failure to parse.

This commit is contained in:
Joseph Lenox 2017-11-06 21:11:17 -06:00
parent add2895f38
commit f366700b44
2 changed files with 2 additions and 1 deletions

View File

@ -44,6 +44,7 @@ std::string evaluate(const std::string& expression_string) {
#if SLIC3R_DEBUG
std::cerr << __FILE__ << ":" << __LINE__ << " "<< "Failed to parse: " << expression_string.c_str() << std::endl;
#endif
result << "{" << expression_string << "}";
}
std::string output = result.str();
trim(output);

View File

@ -41,6 +41,6 @@ use Test::More tests => 6;
my $test_string = "M104 S{a}; Sets temp to {4*5}";
my $result = Slic3r::ConditionalGCode::apply_math($test_string);
is $result, "M104 S; Sets temp to 20", 'Blank string emittal on failure to parse';
is $result, "M104 S{a}; Sets temp to 20", 'Original string emittal on failure to parse';
}
}