comparison src/dil/semantic/Scope.d @ 838:1ecf05e680ba

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.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Wed, 20 Aug 2008 20:39:16 +0200
parents bcb74c9b895c
children
comparison
equal deleted inserted replaced
837:110f741dab45 838:1ecf05e680ba
26 /// Params: 26 /// Params:
27 /// name = the name of the symbol. 27 /// name = the name of the symbol.
28 Symbol lookup(Identifier* name) 28 Symbol lookup(Identifier* name)
29 { 29 {
30 return symbol.lookup(name); 30 return symbol.lookup(name);
31 }
32
33 /// Searches for a symbol in this scope and all enclosing scopes.
34 /// Params:
35 /// name = the name of the symbol.
36 Symbol search(Identifier* name)
37 {
38 Symbol symbol;
39 for (auto sc = this; sc; sc = sc.parent)
40 {
41 symbol = sc.lookup(name);
42 if (symbol !is null)
43 break;
44 }
45 return symbol;
31 } 46 }
32 47
33 /// Create a new inner scope and return that. 48 /// Create a new inner scope and return that.
34 Scope enter(ScopeSymbol symbol) 49 Scope enter(ScopeSymbol symbol)
35 { 50 {