DelphiAST icon indicating copy to clipboard operation
DelphiAST copied to clipboard

Move handling of Defines from Lexer to Parser

Open LaKraven opened this issue 10 years ago • 0 comments

At present, the Castalia Lexer is taking responsibility for dealing with Defines... which means that tokens are only produced for source for which any conditional Defines evaluate as True.

This is incorrect behavior, as the Lexer should generate tokens for the ENTIRE source, and elimination of Define-specific tokens should be handled at the Parser level.

Understandably, this is a non-trivial change to make... however, one possible use-case would be the ability to warn a developer when their source consumes an identifier that is limited by one or more Defines (where the consuming source is not limited by suitable Defines itself).

LaKraven avatar Jan 13 '15 12:01 LaKraven