I was looking at the implementation and it seems while a bool is
returned, no error is ever declared.
Shouldn't:
DeclarationParser parser(context_, current_ , end_ );
if ( !parser.tryParse() )
break;
do a return false; instead of a break ?
Also, at a later time, we will need to introduce error recovery support.
What could be the strategy ?
- Find next ';' and restart parsing.
- Find next '}' and restart parsing (end of function body, this would mean
that we failed to parse a function declaration)
- Find next '{' and walk backward as much as possible until a successful
parse occurs (search for a function/class body start, then search the start
of the declaration associated to the body).
Baptiste.
|