diff --git a/includes/Tokenizer.hpp b/includes/Tokenizer.hpp index 183332b..2adb4ca 100644 --- a/includes/Tokenizer.hpp +++ b/includes/Tokenizer.hpp @@ -56,6 +56,7 @@ namespace config bool hasMoreTokens(); bool firstToken(); void rollBackToken(); + void set_last(e_token type); }; diff --git a/src/config/TOMLParser.cpp b/src/config/TOMLParser.cpp index b07d220..cdb7449 100644 --- a/src/config/TOMLParser.cpp +++ b/src/config/TOMLParser.cpp @@ -48,6 +48,7 @@ namespace config if (nextToken.type == MAPARRAY_DECL) { tokenizer.rollBackToken(); + tokenizer.set_last(NEWLINE); break; } else if (nextToken.type == OPEN_BRACKET) @@ -289,6 +290,7 @@ namespace config if (current.type == MAPARRAY_DECL) { /* parseMapArray(); */ + tokenizer.set_last(NEWLINE); tokenizer.rollBackToken(); parseMapArray(); } diff --git a/src/config/Tokenizer.cpp b/src/config/Tokenizer.cpp index 9b75ec5..5ad54ba 100644 --- a/src/config/Tokenizer.cpp +++ b/src/config/Tokenizer.cpp @@ -204,4 +204,9 @@ namespace config file.clear(); file.seekg(prev_pos); } + + void Tokenizer::set_last(e_token type) + { + last_token = type; + } }