DMD 1.021 and 2.004 releases

Walter Bright newshound1 at digitalmars.com
Wed Sep 12 22:08:23 PDT 2007


Aziz K. wrote:
> Thanks for clarifying. While implementing the methods in my lexer for 
> scanning the new string literals I found a few other ambiguities:
> 
> q"∆abcdef∆" // Might be superfluous to ask, but are (non-alpha) Unicode 
> character delimiters allowed?

Yes.

> q" abcdef " // "abcdef". Allowed?

Yes.

> q"
> äöüß
> " // "äöüß". Should leading newlines be skipped or are they allowed as 
> delimiters?

Skipped.

> q"EOF
> abcdefEOF" // Valid?

No.

> Or is \nEOF a requirement?

Yes.

> If so, how would you 
> write such a string excluding the last newline?

Can't.

> Because you say in the 
> specs that the last newline is part of the string. Maybe it shouldn't be?
> q"EOF
> abcdef
>   EOF" // Provided the previous example is an error. Is indenting the 
> matching delimiter allowed (with " \t\v\f")?

No.

> Walter Bright wrote:
>> Aziz K. wrote:
>>> q{666, this is super __EOF__} // Should __EOF__ be evaluated here 
>>> causing the token string to be unterminated?
>>
>> Yes (__EOF__ is not a token, it's an end of file)
> Are you sure you want __EOF__ to really mean end of file like '\0' and 
> 0x1A (^Z)? Every time one encounters '_', one would have to look ahead 
> for "_EOF__" and one would have to make sure it's not followed by a 
> valid identifier character. I have twelve instances where I check for \0 
> and ^Z. It wouldn't be that hard to adapt the code but I'm sure in 
> general it would impact the speed of a D lexer adversely.
> 
> Regards,
> Aziz



More information about the Digitalmars-d-announce mailing list