mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 07:25:53 +08:00
Emit original string on failure to parse.
This commit is contained in:
parent
add2895f38
commit
f366700b44
@ -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);
|
||||
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user