Mercurial > projects > dil
changeset 464:325714d8aa6c
Added new module with compiler constants to resolve import cycle.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 30 Oct 2007 20:25:42 +0100 |
parents | 12b4ba9248a7 |
children | e0d24e05a9ee |
files | trunk/src/dil/Lexer.d trunk/src/dil/Settings.d trunk/src/main.d |
diffstat | 3 files changed, 2 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/Lexer.d Tue Oct 30 20:54:26 2007 +0200 +++ b/trunk/src/dil/Lexer.d Tue Oct 30 20:25:42 2007 +0100 @@ -9,7 +9,7 @@ import dil.Identifier; import dil.Messages; import dil.HtmlEntities; -import dil.Settings; +import dil.CompilerInfo; import tango.stdc.stdlib : strtof, strtod, strtold; import tango.stdc.errno : errno, ERANGE; import tango.stdc.time : time_t, time, ctime;
--- a/trunk/src/dil/Settings.d Tue Oct 30 20:54:26 2007 +0200 +++ b/trunk/src/dil/Settings.d Tue Oct 30 20:25:42 2007 +0100 @@ -7,43 +7,8 @@ import dil.Parser, dil.SyntaxTree, dil.Declarations, dil.Expressions; import dil.File; import tango.io.FilePath; -import std.metastrings : FormatT = Format, ToString; import common; -template Pad(char[] str, uint amount) -{ - static if (str.length >= amount) - const char[] Pad = str; - else - const char[] Pad = "0" ~ Pad!(str, amount-1); -} - -template Pad(int num, uint amount) -{ - const char[] Pad = Pad!(ToString!(num), amount); -} - -version(D2) -{ - const VERSION_MAJOR = 2; - const VERSION_MINOR = 0; -} -else -{ - const VERSION_MAJOR = 1; - const VERSION_MINOR = 0; -} - -const string VERSION = FormatT!("%s.%s", VERSION_MAJOR, Pad!(VERSION_MINOR, 3)); -const VENDOR = "dil"; - -/// Used in main help message. -const COMPILED_WITH = __VENDOR__; -/// ditto -const COMPILED_VERSION = FormatT!("%s.%s", __VERSION__/1000, Pad!(__VERSION__%1000, 3)); -/// ditto -const COMPILED_DATE = __TIMESTAMP__; - struct GlobalSettings { static:
--- a/trunk/src/main.d Tue Oct 30 20:54:26 2007 +0200 +++ b/trunk/src/main.d Tue Oct 30 20:25:42 2007 +0100 @@ -8,6 +8,7 @@ import dil.Token; import dil.Messages; import dil.Settings; +import dil.CompilerInfo; import dil.Declarations, dil.Expressions, dil.SyntaxTree; import dil.File; import cmd.Generate;