Mercurial > projects > dang
comparison ast/Module.d @ 140:927ae00bd9d2
Added support for extern keyword. Being ignored atm though. Also changed ast/Module, so that you can get a list of only vars, functions or structs.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Sun, 20 Jul 2008 23:23:56 +0200 |
parents | 2be29b296081 |
children | 6e6355fb5f0f |
comparison
equal
deleted
inserted
replaced
136:2be29b296081 | 140:927ae00bd9d2 |
---|---|
12 this.moduleName = moduleName; | 12 this.moduleName = moduleName; |
13 } | 13 } |
14 | 14 |
15 void addDecl(Decl decl) | 15 void addDecl(Decl decl) |
16 { | 16 { |
17 switch(decl.declType) | |
18 { | |
19 case DeclType.FuncDecl: | |
20 functions ~= cast(FuncDecl)decl; | |
21 break; | |
22 case DeclType.VarDecl: | |
23 vars ~= cast(VarDecl)decl; | |
24 break; | |
25 case DeclType.StructDecl: | |
26 structs ~= cast(StructDecl)decl; | |
27 break; | |
28 default: | |
29 assert(0, "DeclType not implemented"); | |
30 } | |
17 decls ~= decl; | 31 decls ~= decl; |
18 } | 32 } |
19 | 33 |
34 VarDecl[] vars; | |
35 FuncDecl[] functions; | |
36 StructDecl[] structs; | |
20 Decl[] decls; | 37 Decl[] decls; |
38 | |
21 char[] moduleName; | 39 char[] moduleName; |
22 Scope env; | 40 Scope env; |
23 Symbol symbol; | 41 Symbol symbol; |
24 bool outputModule = true; | 42 bool outputModule = true; |
25 } | 43 } |