Chromium Code Reviews
DescriptionChange the calling conventions for handleUnrecoverableError.
Instead of returning the token from which parsing should proceed, it
returns a token whose "next" pointer points to the token from which
parsing should proceed.
The rationale is that when error recovery is performed in the context
of the analyzer, the listener will need to insert synthetic tokens
into the token stream which will then be passed to listener methods;
the change in calling conventions allows the listener to return the
synthetic token to the parser.
The other listeners don't need to insert synthetic tokens into the
token stream; they just need to create a synthetic token whose "next"
pointer points to the token from which parsing should proceed. The
convenience method "newSyntheticToken" is added for the benefit of
these listeners.
No code is affected outside of error handling, so the performance
impact when compiling correct code should be zero.
R=ahe@google.com, scheglov@google.com
Committed: https://github.com/dart-lang/sdk/commit/a6804167162f230bf8498289a61dc7efebf32b0c
Patch Set 1 #
Total comments: 14
Patch Set 2 : Address code review comments. #Patch Set 3 : Fix a code path I missed in element_listener.dart #
Messages
Total messages: 7 (2 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||