A number of common patterns in the parser could be abstracted out at probably zero performance cost with a few inline function definitions: - CURRENT_TOKEN - js_MatchToken, js_PeekToken, js_GetToken, js_UngetToken - js_ReportCompilerErrorNumber, js_ReportErrorNumber This should improve readability and maintainability. Dave
Is this a duplicate of bug 549658? We might be able to clean up error reporting more, but I think it's a method of the token stream after that patch, which isn't too bad.
Intended to add a few additional abstractions, e.g. replacing patterns like: tokenStream.flags |= TCF_OPERAND; tt = js_PeekToken(&tokenStream); tokenStream.flags &= ~TCF_OPERAND; with e.g.: tokenStream.peekTokenAs(TCF_OPERAND); But some of these (such as the above) belong in jsscan so I'll wait on this till you and I have a chance to sync up and merge our work. Dave
Feel free to strip TCF_ and similar prefixes by moving enums into classes or structs, as we do elsewhere now that C++ is here to stay. /be