Use own implementation of ctEval

This commit is contained in:
nazrin 2025-06-09 04:28:05 +00:00
parent a45f6a9e17
commit 1a614ac45b
4 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,6 @@
module clox.dbg;
import core.stdc.stdio;
import std.functional : ctEval;
import std.traits : EnumMembers, hasUDA, getUDAs;
import clox.chunk;

View file

@ -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;

View file

@ -1,7 +1,6 @@
module clox.parser;
import core.stdc.stdio;
import std.functional : ctEval;
import clox.scanner;
import clox.compiler;

View file

@ -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",