Mercurial > projects > dil
comparison trunk/src/dil/Settings.d @ 505:3bb94ba21490
Refactored a great amount of code.
Changed many declaration types from Token* to Identifier*.
Fix in parseStructInitializer(): append null to idents in else body.
Fixed class Parameter and parseParameterList().
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Wed, 12 Dec 2007 02:25:42 +0100 |
parents | 325714d8aa6c |
children | 6160ab7b1816 |
comparison
equal
deleted
inserted
replaced
504:9076c4cea2a4 | 505:3bb94ba21490 |
---|---|
31 foreach (decl; root.children) | 31 foreach (decl; root.children) |
32 { | 32 { |
33 auto v = Cast!(VariableDeclaration)(decl); | 33 auto v = Cast!(VariableDeclaration)(decl); |
34 if (v is null) | 34 if (v is null) |
35 continue; | 35 continue; |
36 auto vname = v.idents[0].srcText; | 36 auto vname = v.idents[0].str; |
37 if (vname == "langfile") | 37 if (vname == "langfile") |
38 { | 38 { |
39 auto e = v.values[0]; | 39 auto e = v.values[0]; |
40 if (!e) | 40 if (!e) |
41 throw new Exception("langfile variable has no value set."); | 41 throw new Exception("langfile variable has no value set."); |
74 foreach (decl; root.children) | 74 foreach (decl; root.children) |
75 { | 75 { |
76 auto v = Cast!(VariableDeclaration)(decl); | 76 auto v = Cast!(VariableDeclaration)(decl); |
77 if (v is null) | 77 if (v is null) |
78 continue; | 78 continue; |
79 if (v.idents[0].srcText == "messages") | 79 if (v.idents[0].str == "messages") |
80 { | 80 { |
81 auto e = v.values[0]; | 81 auto e = v.values[0]; |
82 if (!e) | 82 if (!e) |
83 throw new Exception("messages variable in "~fileName~" has no value set."); | 83 throw new Exception("messages variable in "~fileName~" has no value set."); |
84 if (auto array = Cast!(ArrayInitializer)(e)) | 84 if (auto array = Cast!(ArrayInitializer)(e)) |
90 } | 90 } |
91 } | 91 } |
92 else | 92 else |
93 throw new Exception("messages variable is set to "~e.classinfo.name~" instead of an ArrayInitializer."); | 93 throw new Exception("messages variable is set to "~e.classinfo.name~" instead of an ArrayInitializer."); |
94 } | 94 } |
95 else if(v.idents[0].srcText == "lang_code") | 95 else if(v.idents[0].str == "lang_code") |
96 { | 96 { |
97 auto e = v.values[0]; | 97 auto e = v.values[0]; |
98 if (!e) | 98 if (!e) |
99 throw new Exception("lang_code variable in "~fileName~" has no value set."); | 99 throw new Exception("lang_code variable in "~fileName~" has no value set."); |
100 if (auto str = Cast!(StringExpression)(e)) | 100 if (auto str = Cast!(StringExpression)(e)) |