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.
This current use case has no possible parsing with the current parser:
Making
ReadList
public solves the API problem (parser.ReadList(() => parser.Parse(new Tag()))
), but there is another issue. The initialDoWhileBracket
peeks ahead at the next token, which consumes the token (the inner left curly) and so the subsequentDoWhileBracket
doesn't detect the left curly, and so throws an exception.