G-code parsing: enable ; comments
This commit is contained in:
@@ -36,7 +36,7 @@ grbl::program::program(std::string filename) {
|
||||
}
|
||||
|
||||
static auto comment_re = std::regex(R"(\(([^)]*)\))");
|
||||
static auto gcode_re = std::regex(R"(([a-zA-Z0-9\s.\-]+)\s*(\(([^)]*)\))?)");
|
||||
static auto gcode_re = std::regex(R"(([a-zA-Z0-9\s.\-]+)\s*(;.*|\(([^)]*)\))?)");
|
||||
|
||||
bool grbl::program::load_from_stream(std::istream& in) {
|
||||
instructions.clear();
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ TEST(grbl_program, load_from_string) {
|
||||
|
||||
G94 ( Millimeters per minute feed rate. )
|
||||
G21 ( Units == Millimeters. )
|
||||
F600.00000
|
||||
F600.00000 ; another type of comment
|
||||
X3.87739 Y78.52820
|
||||
)";
|
||||
pgm.load_from_string(content);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
G94 ( Millimeters per minute feed rate. )
|
||||
G21 ( Units == Millimeters. )
|
||||
G90 ( Absolute coordinates. )
|
||||
S10000 ( RPM spindle speed. )
|
||||
S20000 ( RPM spindle speed. )
|
||||
|
||||
M3 S24000
|
||||
G4 P3
|
||||
|
||||
Reference in New Issue
Block a user