| 307 | }); |
| 308 | |
| 309 | void Main() { |
| 310 | char *envDebug = getenv("DEBUG_PPCC"); |
| 311 | if (envDebug) { |
| 312 | switch (envDebug[0]) { |
| 313 | case '0': debug = 0; break; |
| 314 | case '1': debug = 1; break; |
| 315 | case '2': debug = 2; break; |
| 316 | default: |
| 317 | Error("invalid DEBUG_PPCC value, must be 0, 1, or 2"); |
| 318 | break; |
| 319 | } |
| 320 | } |
| 321 | if (Args->len() >= 1 && Args->at(0)->eq(S("--test"))) { |
| 322 | for (Int i = 1; i < Args->len(); i++) { |
| 323 | Str *filename = Args->at(i); |
| 324 | PrintLn(S("=== ")->add(filename)); |
| 325 | Print(TestPreProcessor(filename)); |
| 326 | } |
| 327 | return; |
| 328 | } |
| 329 | if (getenv("RUN_PPCC")) { |
| 330 | if (debug) { |
| 331 | PrintLn(S("Args: ")->add(StrJoin(Args, " "))); |
| 332 | } |
| 333 | ParseArgs(); |
| 334 | ExecCompiler(); |
| 335 | } else { |
| 336 | PassThroughCompiler(); |
| 337 | } |
| 338 | } |
nothing calls this directly
no test coverage detected