# HG changeset patch # User Aziz K?ksal # Date 1203467059 -3600 # Node ID 9f61e8af55d597879e4c394afd7501f89dc296f6 # Parent 580d4ca9f1ff8fc18054297bd2aef7b48af7f7cf Added module dil.Compilation. Added predefined ID 'startaddress'. Added keyword 'nothrow'. diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/README --- a/trunk/README Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/README Wed Feb 20 01:24:19 2008 +0100 @@ -11,7 +11,7 @@ How To Compile dil ================== In order to compile dil you need to have: - *) DMD 1.024 (http://www.digitalmars.com/d/1.0/changelog.html) + *) DMD 1.027 (http://www.digitalmars.com/d/1.0/changelog.html) *) Tango 0.99.4 (http://dsource.org/projects/tango/) *) DSSS 0.71 (http://dsource.org/projects/dsss/) diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/cmd/DDoc.d --- a/trunk/src/cmd/DDoc.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/cmd/DDoc.d Wed Feb 20 01:24:19 2008 +0100 @@ -90,10 +90,10 @@ mtable.insert("MODPATH", mod.getFQNPath() ~ mod.fileExtension()); mtable.insert("TITLE", mod.getFQN()); - mtable.insert("DOCFILENAME", mod.getFQN()); + mtable.insert("DOCFILENAME", mod.getFQN() ~ ".html"); auto timeStr = Time.toString(); mtable.insert("DATETIME", timeStr); - mtable.insert("YEAR", timeStr[20..24]); + mtable.insert("YEAR", Time.year(timeStr)); auto doc = new DDocEmitter(mtable, incUndoc, mod, tokenHL); doc.emit(); @@ -429,7 +429,7 @@ auto basesBegin = bases[0].begin.prevNWS; if (basesBegin.kind == TOK.Colon) basesBegin = bases[0].begin; - text ~= " : " ~ escape(textSpan(basesBegin, bases[$-1].end)); + write(" : ", escape(textSpan(basesBegin, bases[$-1].end))); } void write(char[][] strings...) @@ -441,9 +441,7 @@ void SYMBOL(char[] name, Declaration d) { auto loc = d.begin.getRealLocation(); - auto str = Format("$(SYMBOL {}, {}, {}.{}, {})", - name, modul.getFQN(), modul.getFQNPath(), - modul.fileExtension(), loc.lineNum); + auto str = Format("$(SYMBOL {}, {})", name, loc.lineNum); write(str); // write("$(DDOC_PSYMBOL ", name, ")"); } diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/Compilation.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/src/dil/Compilation.d Wed Feb 20 01:24:19 2008 +0100 @@ -0,0 +1,19 @@ +/++ + Author: Aziz Köksal + License: GPL3 ++/ +module dil.Compilation; + +import common; + +/// A group of settings relevant to the compilation process. +class CompilationContext +{ + string[] importPaths; + uint debugLevel; + uint versionLevel; + bool[string] debugIds; + bool[string] versionIds; + bool releaseBuild; + uint structAlign; +} diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/ast/Declarations.d --- a/trunk/src/dil/ast/Declarations.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/ast/Declarations.d Wed Feb 20 01:24:19 2008 +0100 @@ -465,6 +465,19 @@ this.decls = decls; this.elseDecls = elseDecls; } + + bool isSpecification() + { + return decls is null; + } + + bool isCondition() + { + return decls !is null; + } + + /// The branch to be compiled in. + Declaration compiledDecls; } class DebugDeclaration : ConditionalCompilationDeclaration diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/lexer/Identifier.d --- a/trunk/src/dil/lexer/Identifier.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/lexer/Identifier.d Wed Feb 20 01:24:19 2008 +0100 @@ -13,7 +13,7 @@ ///
 ///  Identifier := IdStart IdChar*
 ///  IdStart := "_" | Letter
-///  IdChar := Letter | "0"-"9"
+///  IdChar := IdStart | "0"-"9"
 ///  Letter := UniAlpha
 ///
/// Unicode alphas are defined in Unicode 5.0.0. diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/lexer/IdentsGenerator.d --- a/trunk/src/dil/lexer/IdentsGenerator.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/lexer/IdentsGenerator.d Wed Feb 20 01:24:19 2008 +0100 @@ -24,7 +24,7 @@ // scope: {"exit"}, {"success"}, {"failure"}, // pragma: - {"msg"}, {"lib"}, + {"msg"}, {"lib"}, {"startaddress"}, // Linkage: {"C"}, {"D"}, {"Windows"}, {"Pascal"}, {"System"}, // Con-/Destructor: diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/lexer/Keywords.d --- a/trunk/src/dil/lexer/Keywords.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/lexer/Keywords.d Wed Feb 20 01:24:19 2008 +0100 @@ -68,6 +68,7 @@ {"mixin", TOK.Mixin}, {"module", TOK.Module}, {"new", TOK.New}, + {"nothrow", TOK.Nothrow}, // D2.0 {"null", TOK.Null}, {"out", TOK.Out}, {"override", TOK.Override}, diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/lexer/TokensEnum.d --- a/trunk/src/dil/lexer/TokensEnum.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/lexer/TokensEnum.d Wed Feb 20 01:24:19 2008 +0100 @@ -93,7 +93,7 @@ Finally, For, Foreach, Foreach_reverse, Function, Goto, If, Import, In, Inout, Interface, Invariant, Is, Lazy, Macro/+D2.0+/, - Mixin, Module, New, Null, Out, Override, Package, + Mixin, Module, New, Nothrow/+D2.0+/, Null, Out, Override, Package, Pragma, Private, Protected, Public, Pure/+D2.0+/, Ref, Return, Scope, Static, Struct, Super, Switch, Synchronized, Template, This, Throw, Traits/+D2.0+/, True, Try, Typedef, Typeid, @@ -197,7 +197,7 @@ "finally","for","foreach","foreach_reverse","function","goto", "if","import","in","inout", "interface","invariant","is","lazy","macro", - "mixin","module","new","null","out","override","package", + "mixin","module","new","nothrow","null","out","override","package", "pragma","private","protected","public","pure","ref","return", "scope","static","struct","super","switch","synchronized", "template","this","throw","__traits","true","try","typedef","typeid", diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/semantic/Module.d --- a/trunk/src/dil/semantic/Module.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/semantic/Module.d Wed Feb 20 01:24:19 2008 +0100 @@ -19,7 +19,7 @@ alias FileConst.PathSeparatorChar dirSep; -/// Represents a D module and source file. +/// Represents a semantic D module and a source file. class Module : ScopeSymbol { SourceText sourceText; /// The source file of this module. diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/dil/semantic/Pass1.d --- a/trunk/src/dil/semantic/Pass1.d Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/dil/semantic/Pass1.d Wed Feb 20 01:24:19 2008 +0100 @@ -348,10 +348,19 @@ return d; } - D visit(DebugDeclaration) - { return null; } - D visit(VersionDeclaration) - { return null; } + D visit(DebugDeclaration d) + { + if (d.isSpecification) + { + + } + return null; + } + + D visit(VersionDeclaration d) + { + return null; + } D visit(TemplateDeclaration d) { diff -r 580d4ca9f1ff -r 9f61e8af55d5 trunk/src/macros_dil.ddoc --- a/trunk/src/macros_dil.ddoc Tue Feb 19 19:30:04 2008 +0100 +++ b/trunk/src/macros_dil.ddoc Wed Feb 20 01:24:19 2008 +0100 @@ -1,3 +1,18 @@ +DDOC = + + + $(TITLE) + + +

$(TITLE)

+$(BODY) +
+ + + + +MODFQN = $(TITLE) +SRCFILE = ./htmlsrc/$(MODFQN).html COPYRIGHT = Copyright © 2007-$(YEAR), Aziz Köksal. All rights reserved. -SYMBOL_ = $1 -SYMBOL = $1 +SYMBOL_ = $1 +SYMBOL = $1