On 03/08/2011 07:36 PM, Jonathan M Davis wrote:
Do they _have_ to be in a particular format? I ask because I've slowly been
going through the lexer code, translating it to D for std.lang.d.lex, and I'm
very tempted to just use std.datetime to produce the values for __DATE__,
__TIME__, __TIMESTAMP__. The resulting values would look cleaner IMHO, and the
code would be simpler. However, that _would_ result in a slightly different
format for __DATE__ and __TIMESTAMP__.

Honestly, I didn't even know that these "macros" existed before I ran into them
in the lexer - there's no mention of them on the site as far as I can determine.

http://www.digitalmars.com/d/2.0/lex.html#specialtokens

That also sets the format.

So, I have no idea whether they're exact format is considered important and part
of the spec or not. If the format _is_ important, then I might as well leave it
and have the D code call time and ctime as it does in the C++ code, but I'd just
as soon use std.datetime if the format doesn't have to be absolutely exact.

So, are the formats of __DATE__, __TIME__, and __TIMESTAMP__ exact such that
they should _always_ be as they currently are in the C++ lexer, or are they
flexible enough that I can just simplify the code in the D lexer with
std.datetime?

- Jonathan M Davis
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to