Created
December 21, 2019 09:50
-
-
Save stefantalpalaru/0555e06b5ff8998be44370ed9612742a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nimStackTraceOverride {.strdefine.} = "" | |
when defined(nimStackTraceOverride): | |
import macros | |
macro importModuleFromString(s: static[string]): untyped = | |
if s == "true": | |
# empty command line definition | |
error("You need to specify the module's name with `-d:nimStackTraceOverride=yourModuleHere`") | |
result = newNimNode(nnkImportStmt).add(newIdentNode(s)) | |
importModuleFromString(nimStackTraceOverride) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment