json: removed deprecatedGet pragma

This commit is contained in:
Araq 2019-09-20 20:14:26 +02:00 • committed by Andreas Rumpf
commit 96b3bae99b

View file

@ -153,11 +153,6 @@ export
open, close, str, getInt, getFloat, kind, getColumn, getLine, getFilename, open, close, str, getInt, getFloat, kind, getColumn, getLine, getFilename,
errorMsg, errorMsgExpected, next, JsonParsingError, raiseParseErr errorMsg, errorMsgExpected, next, JsonParsingError, raiseParseErr
when defined(nimJsonGet):
{.pragma: deprecatedGet, deprecated.}
else:
{.pragma: deprecatedGet.}
type type
JsonNodeKind* = enum ## possible JSON node types JsonNodeKind* = enum ## possible JSON node types
JNull, JNull,
@ -475,13 +470,9 @@ proc len*(n: JsonNode): int =
of JObject: result = n.fields.len of JObject: result = n.fields.len
else: discard else: discard
proc `[]`*(node: JsonNode, name: string): JsonNode {.inline, deprecatedGet.} = proc `[]`*(node: JsonNode, name: string): JsonNode {.inline.} =
## Gets a field from a `JObject`, which must not be nil. ## Gets a field from a `JObject`, which must not be nil.
## If the value at `name` does not exist, raises KeyError. ## If the value at `name` does not exist, raises KeyError.
##
## **Note:** The behaviour of this procedure changed in version 0.14.0. To
## get a list of usages and to restore the old behaviour of this procedure,
## compile with the ``-d:nimJsonGet`` flag.
assert(not isNil(node)) assert(not isNil(node))
assert(node.kind == JObject) assert(node.kind == JObject)
when defined(nimJsonGet): when defined(nimJsonGet):