Mercurial > projects > dang
comparison sema/ScopeBuilder.d @ 132:a101853eaae0
Better scope-building. Still an error with structs and forward ref though.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Mon, 30 Jun 2008 16:23:52 +0200 |
parents | 6545a8d59596 |
children | 9c48871eb816 |
comparison
equal
deleted
inserted
replaced
131:3635fc5428b1 | 132:a101853eaae0 |
---|---|
49 | 49 |
50 if (d.init) | 50 if (d.init) |
51 visitExp(d.init); | 51 visitExp(d.init); |
52 | 52 |
53 DType t = typeOf(d.varType, d.env); | 53 DType t = typeOf(d.varType, d.env); |
54 if (inFunctionBodyStack.peek()) | 54 d.sym = current.symbol.createAlias(d.identifier.get,d.env.find(d.varType).sym); |
55 { | |
56 auto find = d.env.find(d.varType); | |
57 d.sym = d.env.find(d.varType).sym; | |
58 } | |
59 else | |
60 d.sym = current.symbol.createMember(d.identifier.get, t); | |
61 } | 55 } |
62 | 56 |
63 override void visitStructDecl(StructDecl s) | 57 override void visitStructDecl(StructDecl s) |
64 { | 58 { |
65 auto st = s.env.findType(s.identifier).asStruct; | 59 auto st = s.env.findType(s.identifier).asStruct; |