mirror of
https://github.com/status-im/nim-json-serialization.git
synced 2025-02-18 04:56:54 +00:00
make nimble file consistent with CI setup (#58)
This commit is contained in:
parent
86ee432dde
commit
b068e1440d
@ -7,7 +7,7 @@ description = "Flexible JSON serialization not relying on run-time type inform
|
|||||||
license = "Apache License 2.0"
|
license = "Apache License 2.0"
|
||||||
skipDirs = @["tests"]
|
skipDirs = @["tests"]
|
||||||
|
|
||||||
requires "nim >= 1.2.0",
|
requires "nim >= 1.6.0",
|
||||||
"serialization",
|
"serialization",
|
||||||
"stew"
|
"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 flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler
|
||||||
let verbose = getEnv("V", "") notin ["", "0"]
|
let verbose = getEnv("V", "") notin ["", "0"]
|
||||||
|
|
||||||
let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error"
|
|
||||||
let cfg =
|
let cfg =
|
||||||
" --styleCheck:usages --styleCheck:" & styleCheckStyle &
|
" --styleCheck:usages --styleCheck:error" &
|
||||||
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
(if verbose: "" else: " --verbosity:0 --hints:off") &
|
||||||
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" &
|
" --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" &
|
||||||
" -d:nimOldCaseObjects"
|
" -d:nimOldCaseObjects"
|
||||||
|
@ -198,35 +198,6 @@ var invalid = Invalid(distance: Mile(100))
|
|||||||
when false: reject invalid.toJson
|
when false: reject invalid.toJson
|
||||||
else: discard invalid
|
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
|
type EnumTestX = enum
|
||||||
x0,
|
x0,
|
||||||
x1,
|
x1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user