mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
fix: reset last token when needed
This commit is contained in:
@@ -56,6 +56,7 @@ namespace config
|
||||
bool hasMoreTokens();
|
||||
bool firstToken();
|
||||
void rollBackToken();
|
||||
void set_last(e_token type);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -204,4 +204,9 @@ namespace config
|
||||
file.clear();
|
||||
file.seekg(prev_pos);
|
||||
}
|
||||
|
||||
void Tokenizer::set_last(e_token type)
|
||||
{
|
||||
last_token = type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user