Changeset 121
- Timestamp:
- 12/27/06 17:32:16 (2 years ago)
- Files:
-
- trunk/bcd.gen/bcd/gen/bcdgen.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bcd.gen/bcd/gen/bcdgen.d
r120 r121 325 325 std.file.remove("bcd/" ~ dNamespace ~ "/template_D.h"); 326 326 } 327 std.file.remove("out.i");327 //std.file.remove("out.i"); 328 328 //std.file.remove("out.xml"); 329 329 … … 2105 2105 bool inOurFile = false; 2106 2106 2107 bool[char[]] curDefines; 2108 2107 2109 while (!f.eof()) { 2108 2110 char[] ln = f.readLine(); … … 2132 2134 if (lns.length >= 3) { 2133 2135 if (isNumeric(lns[2])) { 2136 curDefines[lns[1]] = true; 2137 2134 2138 /* isNumeric can accept ending with 'L', but long is 2135 2139 * (usually) int, so strip it */ … … 2146 2150 " = " ~ lns[2] ~ ";\n"; 2147 2151 } 2152 2148 2153 } else if (lns[2].length >= 2 && 2149 2154 lns[2][0] == '"' && lns[2][$-1] == '"') { 2155 curDefines[lns[1]] = true; 2156 2150 2157 // a constant string 2151 2158 dhead ~= "const char[] " ~ safeName(lns[1]) ~ 2152 2159 " = " ~ lns[2] ~ ";\n"; 2160 2161 } else if (lns[2] in curDefines) { 2162 curDefines[lns[1]] = true; 2163 2164 // could be #define'ing to something already #defined 2165 dhead ~= "alias " ~ safeName(lns[2]) ~ " " ~ safeName(lns[1]) ~ ";\n"; 2153 2166 } 2154 2167 }
