From 05db38ec558aa7128be551f9c8fde8aaaec78b63 Mon Sep 17 00:00:00 2001 From: Adrian Scripca Date: Fri, 5 May 2023 15:40:12 +0300 Subject: [PATCH] Parser: improved comments reader --- grbl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grbl.cpp b/grbl.cpp index 1d9376b..b03d9c1 100644 --- a/grbl.cpp +++ b/grbl.cpp @@ -35,7 +35,7 @@ grbl::program::program(std::string 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*(;.*|\(([^)]*)\))?)"); bool grbl::program::load_from_stream(std::istream& in) {