fixes niminst with stricteffects; add testcase for niminst (#20587)

fixes niminst with stricteffects; add testcase
This commit is contained in:
ringabout
2022-10-18 14:59:02 +08:00
committed by GitHub
parent 81087c949f
commit 15dff4daff
3 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
discard """
action: compile
"""
include tools/niminst/niminst

View File

@@ -9,6 +9,10 @@
import osproc, times, os, strutils
when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
# http://www.debian.org/doc/manuals/maint-guide/
# Required files for debhelper.

View File

@@ -11,6 +11,13 @@ import
os, strutils, parseopt, parsecfg, strtabs, streams, debcreation,
std / sha1
when defined(nimPreviewSlimSystem):
import std/syncio
when not defined(nimHasEffectsOf):
{.pragma: effectsOf.}
const
maxOS = 20 # max number of OSes
maxCPU = 20 # max number of CPUs
@@ -198,7 +205,7 @@ proc parseCmdLine(c: var ConfigData) =
if c.infile.len == 0: quit(Usage)
if c.mainfile.len == 0: c.mainfile = changeFileExt(c.infile, "nim")
proc eqT(a, b: string; t: proc (a: char): char{.nimcall.}): bool =
proc eqT(a, b: string; t: proc (a: char): char {.nimcall.}): bool {.effectsOf: t.} =
## equality under a transformation ``t``. candidate for the stdlib?
var i = 0
var j = 0