# HG changeset patch # User Aziz K?ksal # Date 1219257556 -7200 # Node ID 1ecf05e680bacd3e56abacda411b3b779e3f072e # Parent 110f741dab455be33bb9debf1640e7289a5f073e Changed build configuration. From now on, the executable will be placed in bin/. The postbuild.* scripts for Linux and Windows will place important files in bin/ and bin/data/. Added hasType() to class Expression. Added search() to class Scope. Added DontKnowYet to struct Types. diff -r 110f741dab45 -r 1ecf05e680ba dsss.conf --- a/dsss.conf Thu Aug 14 03:14:43 2008 +0200 +++ b/dsss.conf Wed Aug 20 20:39:16 2008 +0200 @@ -2,7 +2,14 @@ version = 0.1 [src/main.d] type = binary -target = dil +target = bin/dil +version(Windows) { + prebuild = mkdir bin\data + postbuild = scripts\postbuild.bat +} else { + prebuild = mkdir -p bin/data + postbuild = scripts/postbuild.sh +} version(GNU) { buildflags = -Isrc/ -Ldsss_objs/G/cmd.DDoc.o -Ldsss_objs/G/cmd.DDocXML.o } else { diff -r 110f741dab45 -r 1ecf05e680ba scripts/postbuild.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/postbuild.bat Wed Aug 20 20:39:16 2008 +0200 @@ -0,0 +1,2 @@ +copy src\config.d bin\ +copy src\html.css src\html_map.d src\lang_de.d src\lang_en.d src\lang_fi.d src\lang_tr.d src\macros_dil.ddoc src\predefined.ddoc src\predefined_xml.ddoc src\xml.css src\xml_map.d bin\data \ No newline at end of file diff -r 110f741dab45 -r 1ecf05e680ba scripts/postbuild.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/postbuild.sh Wed Aug 20 20:39:16 2008 +0200 @@ -0,0 +1,4 @@ +#!/bin/bash +FILES=`echo -n src/{html.css,html_map.d,lang_de.d,lang_en.d,lang_fi.d,lang_tr.d,macros_dil.ddoc,predefined.ddoc,predefined_xml.ddoc,xml.css,xml_map.d}` +cp src/config.d bin/ +cp $FILES bin/data/ \ No newline at end of file diff -r 110f741dab45 -r 1ecf05e680ba src/dil/ast/Expression.d --- a/src/dil/ast/Expression.d Thu Aug 14 03:14:43 2008 +0200 +++ b/src/dil/ast/Expression.d Wed Aug 20 20:39:16 2008 +0200 @@ -18,5 +18,11 @@ super(NodeCategory.Expression); } + /// Returns true if the member 'type' is not null. + bool hasType() + { + return type !is null; + } + override abstract Expression copy(); } diff -r 110f741dab45 -r 1ecf05e680ba src/dil/semantic/Pass2.d --- a/src/dil/semantic/Pass2.d Thu Aug 14 03:14:43 2008 +0200 +++ b/src/dil/semantic/Pass2.d Wed Aug 20 20:39:16 2008 +0200 @@ -103,12 +103,7 @@ Symbol symbol; if (idScope is null) - for (auto sc = scop; sc; sc = sc.parent) - { - symbol = sc.lookup(id); - if (symbol) - return symbol; - } + symbol = scop.search(id); else symbol = idScope.lookup(id); diff -r 110f741dab45 -r 1ecf05e680ba src/dil/semantic/Scope.d --- a/src/dil/semantic/Scope.d Thu Aug 14 03:14:43 2008 +0200 +++ b/src/dil/semantic/Scope.d Wed Aug 20 20:39:16 2008 +0200 @@ -30,6 +30,21 @@ return symbol.lookup(name); } + /// Searches for a symbol in this scope and all enclosing scopes. + /// Params: + /// name = the name of the symbol. + Symbol search(Identifier* name) + { + Symbol symbol; + for (auto sc = this; sc; sc = sc.parent) + { + symbol = sc.lookup(name); + if (symbol !is null) + break; + } + return symbol; + } + /// Create a new inner scope and return that. Scope enter(ScopeSymbol symbol) { diff -r 110f741dab45 -r 1ecf05e680ba src/dil/semantic/Types.d --- a/src/dil/semantic/Types.d Thu Aug 14 03:14:43 2008 +0200 +++ b/src/dil/semantic/Types.d Wed Aug 20 20:39:16 2008 +0200 @@ -359,6 +359,7 @@ TypePointer Void_ptr; /// The void pointer type. TypeBasic Error; /// The error type. TypeBasic Undefined; /// The undefined type. + TypeBasic DontKnowYet; /// The symbol is undefined but might be resolved. /// Allocates an instance of TypeBasic and assigns it to typeName. template newTB(char[] typeName) @@ -406,5 +407,6 @@ Void_ptr = Void.ptrTo; Error = new TypeBasic(TYP.Error); Undefined = new TypeBasic(TYP.Error); + DontKnowYet = new TypeBasic(TYP.Error); } }