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 hasMoreTokens();
|
||||||
bool firstToken();
|
bool firstToken();
|
||||||
void rollBackToken();
|
void rollBackToken();
|
||||||
|
void set_last(e_token type);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace config
|
|||||||
if (nextToken.type == MAPARRAY_DECL)
|
if (nextToken.type == MAPARRAY_DECL)
|
||||||
{
|
{
|
||||||
tokenizer.rollBackToken();
|
tokenizer.rollBackToken();
|
||||||
|
tokenizer.set_last(NEWLINE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (nextToken.type == OPEN_BRACKET)
|
else if (nextToken.type == OPEN_BRACKET)
|
||||||
@@ -289,6 +290,7 @@ namespace config
|
|||||||
if (current.type == MAPARRAY_DECL)
|
if (current.type == MAPARRAY_DECL)
|
||||||
{
|
{
|
||||||
/* parseMapArray(); */
|
/* parseMapArray(); */
|
||||||
|
tokenizer.set_last(NEWLINE);
|
||||||
tokenizer.rollBackToken();
|
tokenizer.rollBackToken();
|
||||||
parseMapArray();
|
parseMapArray();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,4 +204,9 @@ namespace config
|
|||||||
file.clear();
|
file.clear();
|
||||||
file.seekg(prev_pos);
|
file.seekg(prev_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tokenizer::set_last(e_token type)
|
||||||
|
{
|
||||||
|
last_token = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user