nickbabcock / Pdoxcl2Sharp

A Paradox Interactive general file parser
MIT License
39 stars 13 forks source link

Nested Brackets #23

Closed nickbabcock closed 10 years ago

nickbabcock commented 10 years ago

This current use case has no possible parsing with the current parser:

attachments=
{
    {
        id=2296
        type=54
    }

    {
        id=61768
        type=4713
    }
}

Making ReadList public solves the API problem (parser.ReadList(() => parser.Parse(new Tag()))), but there is another issue. The initial DoWhileBracket peeks ahead at the next token, which consumes the token (the inner left curly) and so the subsequent DoWhileBracket doesn't detect the left curly, and so throws an exception.