Closed lucaswerkmeister closed 10 years ago
Note to future, potentially confused self: This should not be fixed in the FormattingWriter
– e. g., by detecting “we’re already past this token, ignore it” – but must be fixed in the Visitor: a solution in the FormattingWriter
wouldn’t work in the case of no TokenStream
(see #17).
(Past token detection might still be useful for diagnostics though.)
this is currently not expected and thus leads to every subsequent token being unexpected, each with a huge stacktrace.
Actually, that’s not true. The token is not written, handleException
is called, and then the visit continues normally (handleException
only prints a stacktrace). Since no token was fast-forwarded over, the rest of the formatting process can continue normally.
That’s actually bad for automated testing...
In
the
ExistsCondition
has aVariable
withmainToken
myVar
, and also aspecifierExpression
(what would normally be= someExpression.fooBar
) that boils down to theIdentifier
myVar
as well. That is to say, the tokenmyVar
is used twice in the AST; this is currently not expected and thus leads to every subsequent token being unexpected, each with a huge stacktrace. Lovely.(The test only tests
if(exists c =test.first) { ... }
, which works because there’s an actualSpecifierExpression
.)