Parser: improved comments reader

This commit is contained in:
2023-05-05 15:40:12 +03:00
parent 4f9aed3996
commit 05db38ec55
+1 -1
View File
@@ -35,7 +35,7 @@ grbl::program::program(std::string filename) {
load_from_file(std::move(filename)); load_from_file(std::move(filename));
} }
static auto comment_re = std::regex(R"(\(([^)]*)\))"); static auto comment_re = std::regex(R"(^\s*\(([^)]*)\)\s*$)");
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) { bool grbl::program::load_from_stream(std::istream& in) {