diff --git a/Grbl_Esp32/src/Configuration/ParserHandler.h b/Grbl_Esp32/src/Configuration/ParserHandler.h index cb456e7d..efbc5931 100644 --- a/Grbl_Esp32/src/Configuration/ParserHandler.h +++ b/Grbl_Esp32/src/Configuration/ParserHandler.h @@ -50,6 +50,7 @@ namespace Configuration { _parser.enter(); for (; !_parser.isEndSection(); _parser.moveNext()) { value->handle(*this); + _previousIsLeave = false; } _parser.leave(); _previousIsLeave = true; @@ -112,5 +113,10 @@ namespace Configuration { } HandlerType handlerType() override { return HandlerType::Parser; } + + void moveNext() { + _previousIsLeave = false; + _parser.moveNext(); + } }; } diff --git a/Grbl_Esp32/src/MachineConfig.cpp b/Grbl_Esp32/src/MachineConfig.cpp index dc307744..3c447aad 100644 --- a/Grbl_Esp32/src/MachineConfig.cpp +++ b/Grbl_Esp32/src/MachineConfig.cpp @@ -544,7 +544,7 @@ bool MachineConfig::load(const char* filename) { Configuration::Parser parser(input->begin(), input->end()); Configuration::ParserHandler handler(parser); - for (; !parser.isEndSection(); parser.moveNext()) { + for (; !parser.isEndSection(); handler.moveNext()) { log_info("Parsing key " << parser.key().str()); config->handle(handler); } diff --git a/Grbl_Esp32/test/Configuration/YamlTreeBuilder.cpp b/Grbl_Esp32/test/Configuration/YamlTreeBuilder.cpp index ceee3397..fd0731a1 100644 --- a/Grbl_Esp32/test/Configuration/YamlTreeBuilder.cpp +++ b/Grbl_Esp32/test/Configuration/YamlTreeBuilder.cpp @@ -55,7 +55,7 @@ namespace Configuration { ParserHandler handler(p); test.handle(handler); - for (; !p.isEndSection(); p.moveNext()) { + for (; !p.isEndSection(); handler.moveNext()) { test.handle(handler); } }