make nimble file consistent with CI setup (#58)

This commit is contained in:
tersec 2023-06-10 05:15:58 +00:00 committed by GitHub
parent 86ee432dde
commit b068e1440d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 32 deletions

View File

@ -7,7 +7,7 @@ description = "Flexible JSON serialization not relying on run-time type inform
license = "Apache License 2.0"
skipDirs = @["tests"]
requires "nim >= 1.2.0",
requires "nim >= 1.6.0",
"serialization",
"stew"
@ -16,9 +16,8 @@ let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
let verbose = getEnv("V", "") notin ["", "0"]
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
let cfg =
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
" --styleCheck:usages --styleCheck:error" &
(if verbose: "" else: " --verbosity:0 --hints:off") &
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" &
" -d:nimOldCaseObjects"

View File

@ -198,35 +198,6 @@ var invalid = Invalid(distance: Mile(100))
when false: reject invalid.toJson
else: discard invalid
when (NimMajor, NimMinor) < (1, 4): # Copy from `std/strutils`
#
#
# Nim's Runtime Library
# (c) Copyright 2012 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
#
func nimIdentNormalize*(s: string): string =
## Normalizes the string `s` as a Nim identifier.
##
## That means to convert to lower case and remove any '_' on all characters
## except first one.
runnableExamples:
doAssert nimIdentNormalize("Foo_bar") == "Foobar"
result = newString(s.len)
if s.len > 0:
result[0] = s[0]
var j = 1
for i in 1..len(s) - 1:
if s[i] in {'A'..'Z'}:
result[j] = chr(ord(s[i]) + (ord('a') - ord('A')))
inc j
elif s[i] != '_':
result[j] = s[i]
inc j
if j != s.len: setLen(result, j)
type EnumTestX = enum
x0,
x1,