Mercurial > projects > dang
comparison sema/ScopeBuilder.d @ 158:57b0b4464a0b
Parsing "new", putting it in AST and performs some tests on it. Eg. if the contructor exists and the params matches.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 22 Jul 2008 00:33:58 +0200 |
parents | 393a1f47a6d2 |
children | 0f38f1a0f06f |
comparison
equal
deleted
inserted
replaced
157:bb01c1dc452a | 158:57b0b4464a0b |
---|---|
41 inFunctionBodyStack.pop(); | 41 inFunctionBodyStack.pop(); |
42 | 42 |
43 d.sym = current.symbol.createMember( | 43 d.sym = current.symbol.createMember( |
44 d.identifier.get, | 44 d.identifier.get, |
45 d.type, | 45 d.type, |
46 d.env.find(d.identifier.get)); | 46 d); |
47 } | 47 } |
48 | 48 |
49 override void visitVarDecl(VarDecl d) | 49 override void visitVarDecl(VarDecl d) |
50 { | 50 { |
51 visitExp(d.varType); | 51 visitExp(d.varType); |
56 | 56 |
57 DType t = typeOf(d.varType, d.env); | 57 DType t = typeOf(d.varType, d.env); |
58 d.sym = current.symbol.createAlias( | 58 d.sym = current.symbol.createAlias( |
59 d.identifier.get, | 59 d.identifier.get, |
60 d.env.find(d.varType.get).sym, | 60 d.env.find(d.varType.get).sym, |
61 d.env.find(d.identifier.get)); | 61 d); |
62 d.sym.type = t; | 62 d.sym.type = t; |
63 } | 63 } |
64 | 64 |
65 override void visitStructDecl(StructDecl s) | 65 override void visitStructDecl(StructDecl s) |
66 { | 66 { |