Attributes (lexical)

rumbu rumbu at
Thu Nov 25 12:16:50 UTC 2021

On Thursday, 25 November 2021 at 11:25:49 UTC, Ola Fosheim 
Grøstad wrote:
> On Thursday, 25 November 2021 at 10:41:05 UTC, Rumbu wrote:
>> I am not asking this questions out of thin air, I am trying to 
>> write a conforming lexer and this is one of the ambiguities.
> I think it is easier to just look at the lexer in the dmd 
> source. The D language does not really have a proper spec, it 
> is more like an effort to document the implementation.

I try to base my reasoning on specification, dmd is not always a 
good source of information, the lexer is polluted by old features 
or right now by the ImportC feature, trying to lex D an C in the 
same time.

DMD skips the new line if the file was not specified, that's why 
the "filename" is unexpected on a new line:

libdparse completely ignores the contents after #line skipping 
everything until EOL, even a EOF/NUL marker which should end the 

More information about the Digitalmars-d-learn mailing list