Mercurial > projects > dil
comparison src/dil/semantic/Analysis.d @ 823:fde064aca673
Added support for version(unittest).
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Mon, 24 Mar 2008 18:53:15 +0100 |
parents | bcb74c9b895c |
children |
comparison
equal
deleted
inserted
replaced
822:fd52beaaa94a | 823:fde064aca673 |
---|---|
93 /// Returns true if the first branch (of a version declaration/statement) or | 93 /// Returns true if the first branch (of a version declaration/statement) or |
94 /// false if the else-branch should be compiled in. | 94 /// false if the else-branch should be compiled in. |
95 bool versionBranchChoice(Token* cond, CompilationContext context) | 95 bool versionBranchChoice(Token* cond, CompilationContext context) |
96 { | 96 { |
97 assert(cond); | 97 assert(cond); |
98 if (cond.kind == TOK.Identifier) | 98 if (cond.kind == TOK.Identifier || cond.kind == TOK.Unittest) |
99 { | 99 { |
100 if (context.findVersionId(cond.ident.str)) | 100 if (context.findVersionId(cond.ident.str)) |
101 return true; | 101 return true; |
102 } | 102 } |
103 else if (cond.uint_ >= context.versionLevel) | 103 else if (cond.uint_ >= context.versionLevel) |