[PATCH] D: Fix classification of module.type in lexer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[PATCH] D: Fix classification of module.type in lexer

Iain Buclaw
The two-tier lexer, whose job is to resolve fully qualified names
missed a case where 'module.type' was not being classified as one
token.  And so when the Yacc grammar kicks in, it resolved the tokens
as "TypeExp . IdentifierExp", which then will never match the rule for
cast expressions "( TypeExp ) UnaryExpression".

Adding a case for TYPE_CODE_MODULE in type_aggregate_p means that
classify_inner_name will get a chance to look-up the symbol.

This was noticed when someone tried 'watch -l', and got the rather
confusing response:

A syntax error in expression, near `) 0x000000010'.

So it's been included in the testsuite, along with another test that
does effectively the same expression explicitly.

dlang-watch-location.patch (5K) Download Attachment