|
From: Baptiste L. <gai...@fr...> - 2003-04-28 20:09:21
|
I was reading some of the new parsing code, that is template parsing:
---
if (tryNextIs('<'))
{
// skipping all the parameters until next '>'
findNextBalanced('<','>');
---
The issue is not specific to that code, it's just the one that got me
thinking. We know an obvious way to have findNextBalanced fails is to have
some constant comparison expression in the template parameter (very unlikely
though), that is "template <const bool optimize = sizeof(A) < sizeof(B) >
... ;"
While it is not dramatic if we failed to parse this correctly, but it
would be better if we could do some error recovery. One of the way I think
this could be achieve would be by introducing a findNextBalanced, but stop
parsing if '{' or ';' is found. Then the error recovery could start here.
What do you think ?
Baptiste.
|