From e7e0648829199531c9665f5168f5eec98c646854 Mon Sep 17 00:00:00 2001 From: smt Date: Fri, 12 Jan 2018 13:57:58 +0000 Subject: [PATCH 1/3] Update two links in tutorial to compiler usage docs with updated page anchors Seems like these class ids on the page were renamed to reflect their hierarchy but the tutorial links weren't pointing to them, this should fix that --- doc/tut1.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tut1.rst b/doc/tut1.rst index 9e6f1ab3c2..f935e79354 100644 --- a/doc/tut1.rst +++ b/doc/tut1.rst @@ -41,7 +41,7 @@ Save this code to the file "greetings.nim". Now compile and run it:: nim compile --run greetings.nim -With the ``--run`` `switch `_ Nim +With the ``--run`` `switch `_ Nim executes the file automatically after compilation. You can give your program command line arguments by appending them after the filename:: @@ -58,7 +58,7 @@ To compile a release version use:: By default the Nim compiler generates a large amount of runtime checks aiming for your debugging pleasure. With ``-d:release`` these checks are `turned off and optimizations are turned on -`_. +`_. Though it should be pretty obvious what the program does, I will explain the syntax: statements which are not indented are executed when the program From 38fde80b35d866ca36db680498c0f32936369c7e Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 13 Jan 2018 10:57:51 +0100 Subject: [PATCH 2/3] strformat: fixes new 'fmt' template --- lib/pure/strformat.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim index c771343c32..62b095cb1f 100644 --- a/lib/pure/strformat.nim +++ b/lib/pure/strformat.nim @@ -417,6 +417,7 @@ template fmt*(pattern: string): untyped = ## ## let example = "oh, look no conflicts anymore" ## echo fmt"{example}" + bind `%` %pattern proc mkDigit(v: int, typ: char): string {.inline.} = From 6db1b492e12490be976c3aeda3a54eddf59cdc04 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Sun, 14 Jan 2018 09:22:48 -0500 Subject: [PATCH 3/3] Include target in tester nimcache hash (#7053) --- tests/testament/categories.nim | 11 ++++++----- tests/testament/tester.nim | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index 42e19d3dd0..06decfa3c7 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -17,11 +17,12 @@ const rodfilesDir = "tests/rodfiles" proc delNimCache(filename, options: string) = - let dir = nimcacheDir(filename, options) - try: - removeDir(dir) - except OSError: - echo "[Warning] could not delete: ", dir + for target in low(TTarget)..high(TTarget): + let dir = nimcacheDir(filename, options, target) + try: + removeDir(dir) + except OSError: + echo "[Warning] could not delete: ", dir proc runRodFiles(r: var TResults, cat: Category, options: string) = template test(filename: string, clearCacheFirst=false) = diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 870f9f8656..918de881ff 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -71,13 +71,14 @@ proc getFileDir(filename: string): string = if not result.isAbsolute(): result = getCurrentDir() / result -proc nimcacheDir(filename, options: string): string = +proc nimcacheDir(filename, options: string, target: TTarget): string = ## Give each test a private nimcache dir so they don't clobber each other's. - return "nimcache" / (filename & '_' & options.getMD5) + let hashInput = options & $target + return "nimcache" / (filename & '_' & hashInput.getMD5) proc callCompiler(cmdTemplate, filename, options: string, target: TTarget, extraOptions=""): TSpec = - let nimcache = nimcacheDir(filename, options) + let nimcache = nimcacheDir(filename, options, target) let options = options & " --nimCache:" & nimcache.quoteShell & extraOptions let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target], "options", options, "file", filename.quoteShell, @@ -231,7 +232,7 @@ proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest, target: TTarg proc generatedFile(test: TTest, target: TTarget): string = let (_, name, _) = test.name.splitFile let ext = targetToExt[target] - result = nimcacheDir(test.name, test.options) / + result = nimcacheDir(test.name, test.options, target) / (if target == targetJS: "" else: "compiler_") & name.changeFileExt(ext) @@ -334,7 +335,7 @@ proc testSpec(r: var TResults, test: TTest, target = targetC) = var exeFile: string if isJsTarget: let (_, file, _) = splitFile(tname) - exeFile = nimcacheDir(test.name, test.options) / file & ".js" + exeFile = nimcacheDir(test.name, test.options, target) / file & ".js" else: exeFile = changeFileExt(tname, ExeExt)