add noSolve mode
This commit is contained in:
parent
6f5d482865
commit
2d16655c21
2 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import std/[algorithm, os, sequtils]
|
import std/[algorithm, os, strformat, sequtils]
|
||||||
|
|
||||||
--noNimblePath
|
--noNimblePath
|
||||||
--path:"./src"
|
--path:"./src"
|
||||||
|
@ -6,4 +6,7 @@ import std/[algorithm, os, sequtils]
|
||||||
task solve, "run all solutions":
|
task solve, "run all solutions":
|
||||||
for dir in walkDirRec("solutions", yieldFilter = {pcDir}).toSeq().sortedByIt(it):
|
for dir in walkDirRec("solutions", yieldFilter = {pcDir}).toSeq().sortedByIt(it):
|
||||||
echo "--",dir,"--"
|
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
|
||||||
|
|
|
@ -6,6 +6,7 @@ import std/[
|
||||||
macro solve*(arg: untyped): untyped =
|
macro solve*(arg: untyped): untyped =
|
||||||
arg.expectKind nnkStmtList
|
arg.expectKind nnkStmtList
|
||||||
result = newStmtList()
|
result = newStmtList()
|
||||||
|
when defined(noSolve): return
|
||||||
for stmt in arg:
|
for stmt in arg:
|
||||||
stmt.expectKind nnkCall
|
stmt.expectKind nnkCall
|
||||||
stmt[0].expectKind nnkStrLit
|
stmt[0].expectKind nnkStrLit
|
||||||
|
|
Loading…
Reference in a new issue