Use own implementation of ctEval
This commit is contained in:
parent
a45f6a9e17
commit
1a614ac45b
4 changed files with 7 additions and 5 deletions
|
|
@ -1,7 +1,6 @@
|
|||
module clox.dbg;
|
||||
|
||||
import core.stdc.stdio;
|
||||
import std.functional : ctEval;
|
||||
import std.traits : EnumMembers, hasUDA, getUDAs;
|
||||
|
||||
import clox.chunk;
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ int runMain(ulong argc, const char** argv){
|
|||
if(arg[0] == '-'){
|
||||
foreach(c; arg[1 .. $]){
|
||||
switch(c){
|
||||
debug(printCode) case 'p': vm.printCode = true; break;
|
||||
debug(traceExec) case 't': vm.traceExec = true; break;
|
||||
debug(printCode){ case 'p': vm.printCode = true; break; }
|
||||
debug(traceExec){ case 't': vm.traceExec = true; break; }
|
||||
default:
|
||||
usage();
|
||||
return 64;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
module clox.parser;
|
||||
|
||||
import core.stdc.stdio;
|
||||
import std.functional : ctEval;
|
||||
|
||||
import clox.scanner;
|
||||
import clox.compiler;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ module clox.util;
|
|||
import core.stdc.stdio;
|
||||
import core.stdc.stdlib;
|
||||
import core.stdc.string;
|
||||
import std.functional : ctEval;
|
||||
|
||||
auto ctEval(alias v)(){
|
||||
enum evaled = v;
|
||||
return evaled;
|
||||
}
|
||||
|
||||
enum Colour : string{
|
||||
Black = "30", Red = "31", Green = "32", Yellow = "33", Blue = "34", Pink = "35", Cyan = "36",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue