DMD 1.021 and 2.004 releases
Aziz K.
aziz.kerim at gmail.com
Tue Sep 11 03:43:10 PDT 2007
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?
q" abcdef " // "abcdef". Allowed?
q"
äöüß
" // "äöüß". Should leading newlines be skipped or are they allowed as
delimiters?
q"EOF
abcdefEOF" // Valid? Or is \nEOF a requirement? If so, how would you write
such a string excluding the last newline? 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")?
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