mirror of https://github.com/status-im/NimYAML.git
Merge branch 'devel'
This commit is contained in:
commit
dcdb04b79d
|
@ -1,3 +1,10 @@
|
||||||
|
### 0.6.2
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
|
||||||
|
* Fixed problem when serializing a type that overloads the `==` operator (#19)
|
||||||
|
* Fixed type hints for floats (`0` digit was not processed properly)
|
||||||
|
|
||||||
### 0.6.1
|
### 0.6.1
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -14,18 +14,18 @@ type
|
||||||
ythOF, ythOFF,
|
ythOF, ythOFF,
|
||||||
ythT, ythTR, ythTRU, ythTRUE,
|
ythT, ythTR, ythTRU, ythTRUE,
|
||||||
ythY, ythYE, ythYES,
|
ythY, ythYE, ythYES,
|
||||||
|
|
||||||
ythPoint, ythPointI, ythPointIN, ythPointINF,
|
ythPoint, ythPointI, ythPointIN, ythPointINF,
|
||||||
ythPointN, ythPointNA, ythPointNAN,
|
ythPointN, ythPointNA, ythPointNAN,
|
||||||
|
|
||||||
ythLowerFA, ythLowerFAL, ythLowerFALS,
|
ythLowerFA, ythLowerFAL, ythLowerFALS,
|
||||||
ythLowerNU, ythLowerNUL,
|
ythLowerNU, ythLowerNUL,
|
||||||
ythLowerOF,
|
ythLowerOF,
|
||||||
ythLowerTR, ythLowerTRU,
|
ythLowerTR, ythLowerTRU,
|
||||||
ythLowerYE,
|
ythLowerYE,
|
||||||
|
|
||||||
ythPointLowerIN, ythPointLowerN, ythPointLowerNA,
|
ythPointLowerIN, ythPointLowerN, ythPointLowerNA,
|
||||||
|
|
||||||
ythMinus, yth0, ythInt, ythDecimal, ythNumE, ythNumEPlusMinus, ythExponent
|
ythMinus, yth0, ythInt, ythDecimal, ythNumE, ythNumEPlusMinus, ythExponent
|
||||||
|
|
||||||
macro typeHintStateMachine(c: untyped, content: untyped): stmt =
|
macro typeHintStateMachine(c: untyped, content: untyped): stmt =
|
||||||
|
@ -33,7 +33,7 @@ macro typeHintStateMachine(c: untyped, content: untyped): stmt =
|
||||||
result = newNimNode(nnkCaseStmt, content).add(copyNimNode(c))
|
result = newNimNode(nnkCaseStmt, content).add(copyNimNode(c))
|
||||||
for branch in content.children:
|
for branch in content.children:
|
||||||
assert branch.kind == nnkOfBranch
|
assert branch.kind == nnkOfBranch
|
||||||
var
|
var
|
||||||
charBranch = newNimNode(nnkOfBranch, branch)
|
charBranch = newNimNode(nnkOfBranch, branch)
|
||||||
i = 0
|
i = 0
|
||||||
stateBranches = newNimNode(nnkCaseStmt, branch).add(
|
stateBranches = newNimNode(nnkCaseStmt, branch).add(
|
||||||
|
@ -77,6 +77,7 @@ template advanceTypeHint(ch: char) {.dirty.} =
|
||||||
of '0':
|
of '0':
|
||||||
[ythInitial, ythMinus] => yth0
|
[ythInitial, ythMinus] => yth0
|
||||||
[ythNumE, ythNumEPlusMinus] => ythExponent
|
[ythNumE, ythNumEPlusMinus] => ythExponent
|
||||||
|
[ythInt, ythDecimal, ythExponent] => nil
|
||||||
of '1'..'9':
|
of '1'..'9':
|
||||||
[ythInitial, ythMinus] => ythInt
|
[ythInitial, ythMinus] => ythInt
|
||||||
[ythNumE, ythNumEPlusMinus] => ythExponent
|
[ythNumE, ythNumEPlusMinus] => ythExponent
|
||||||
|
|
|
@ -729,7 +729,7 @@ proc representChild*[T](value: seq[T], ts: TagStyle, c: SerializationContext):
|
||||||
|
|
||||||
proc representChild*[O](value: ref O, ts: TagStyle, c: SerializationContext):
|
proc representChild*[O](value: ref O, ts: TagStyle, c: SerializationContext):
|
||||||
RawYamlStream =
|
RawYamlStream =
|
||||||
if value == nil:
|
if isNil(value):
|
||||||
result = iterator(): YamlStreamEvent =
|
result = iterator(): YamlStreamEvent =
|
||||||
yield scalarEvent("~", yTagNull)
|
yield scalarEvent("~", yTagNull)
|
||||||
elif c.style == asNone: result = representChild(value[], ts, c)
|
elif c.style == asNone: result = representChild(value[], ts, c)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.6.1"
|
version = "0.6.2"
|
||||||
author = "Felix Krause"
|
author = "Felix Krause"
|
||||||
description = "YAML 1.2 implementation for Nim"
|
description = "YAML 1.2 implementation for Nim"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
Loading…
Reference in New Issue