diff --git a/grbl.cpp b/grbl.cpp index c5ef1f6..1d9376b 100644 --- a/grbl.cpp +++ b/grbl.cpp @@ -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(); diff --git a/grbl_test.cpp b/grbl_test.cpp index 57dd300..f921568 100644 --- a/grbl_test.cpp +++ b/grbl_test.cpp @@ -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); diff --git a/program.nc b/program.nc index 4ce4449..42d5628 100644 --- a/program.nc +++ b/program.nc @@ -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