Recognize empty string as !!null

This commit is contained in:
Felix Krause 2017-01-12 11:19:46 +01:00
parent 608d9ef090
commit 538a2d2deb
1 changed files with 1 additions and 1 deletions

View File

@ -267,7 +267,7 @@ proc guessType*(scalar: string): TypeHint {.raises: [].} =
var typeHintState: YamlTypeHintState = ythInitial var typeHintState: YamlTypeHintState = ythInitial
for c in scalar: advanceTypeHint(c) for c in scalar: advanceTypeHint(c)
case typeHintState case typeHintState
of ythNULL: result = yTypeNull of ythNULL, ythInitial: result = yTypeNull
of ythTRUE, ythON, ythYES, ythY: result = yTypeBoolTrue of ythTRUE, ythON, ythYES, ythY: result = yTypeBoolTrue
of ythFALSE, ythOFF, ythNO, ythN: result = yTypeBoolFalse of ythFALSE, ythOFF, ythNO, ythN: result = yTypeBoolFalse
of ythInt1, ythInt2, ythInt3, ythInt4, ythInt, yth0: result = yTypeInteger of ythInt1, ythInt2, ythInt3, ythInt4, ythInt, yth0: result = yTypeInteger