add MAPARRAY token detection

This commit is contained in:
3lswear
2022-01-12 13:31:29 +03:00
parent 4deafefc7c
commit 7ec6f2d8a2

View File

@@ -144,10 +144,39 @@ namespace config
file.get(c);
}
}
else if (c == '[')
token.type = ARR_OPEN;
else if (c == ']')
token.type = ARR_CLOSE;
{
std::streampos prev_pos = file.tellg();
file.get(c);
if (c == ']')
{
token.type = MAPARRAY_CLOSE;
}
else
{
token.type = ARR_CLOSE;
file.seekg(prev_pos);
}
}
else if (c == '[')
{
std::streampos prev_pos = file.tellg();
file.get(c);
if (c == '[')
{
token.type = MAPARRAY_OPEN;
}
else
{
token.type = ARR_OPEN;
file.seekg(prev_pos);
}
}
/* else if (c == '[') */
/* token.type = ARR_OPEN; */
/* else if (c == ']') */
/* token.type = ARR_CLOSE; */
else if (c == '=')
token.type = ASSIGN;
else if (c == '\n')