diff --git a/config.nims b/config.nims index 9f149aa..174ab5a 100644 --- a/config.nims +++ b/config.nims @@ -1,4 +1,4 @@ -import std/[algorithm, os, sequtils] +import std/[algorithm, os, strformat, sequtils] --noNimblePath --path:"./src" @@ -6,4 +6,7 @@ import std/[algorithm, os, sequtils] task solve, "run all solutions": for dir in walkDirRec("solutions", yieldFilter = {pcDir}).toSeq().sortedByIt(it): echo "--",dir,"--" - selfExec "r --hint:all:off " & dir & "/solution.nim" + var cmd = "r --hint:all:off " + when defined(noSolve): cmd &= "-d:noSolve" + cmd &= fmt" {dir}/solution.nim " + selfExec cmd diff --git a/src/aoc.nim b/src/aoc.nim index fa10b8e..6452605 100644 --- a/src/aoc.nim +++ b/src/aoc.nim @@ -6,6 +6,7 @@ import std/[ macro solve*(arg: untyped): untyped = arg.expectKind nnkStmtList result = newStmtList() + when defined(noSolve): return for stmt in arg: stmt.expectKind nnkCall stmt[0].expectKind nnkStrLit