From 1dbb1a83277dd0e4afc8c5e17a6180199a445700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helmut=20H=C3=A4nsel?= Date: Fri, 13 Oct 2023 12:27:54 +0200 Subject: [PATCH] no parsing of jsontext in lower() --- ext/StippleJSON.jl | 2 +- ext/StippleJSONExt.jl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/StippleJSON.jl b/ext/StippleJSON.jl index f12b0202..33d74c1e 100644 --- a/ext/StippleJSON.jl +++ b/ext/StippleJSON.jl @@ -2,7 +2,7 @@ JSON.JSONText(json::Stipple.JSONText) = JSON.JSONText(json.s) JSON.show_json(io::JSON.Writer.CompactContext, s::JSON.Writer.CS, json::Stipple.JSONText) = write(io, json.s) -JSON.Writer.lower(json::Stipple.JSONText) = JSON.parse(json.s) +JSON.Writer.lower(json::Stipple.JSONText) = json.s Stipple.JSONText(json::JSON.JSONText) = Stipple.JSONText(json.s) @inline StructTypes.StructType(::Type{JSON.JSONText}) = JSON3.RawType() diff --git a/ext/StippleJSONExt.jl b/ext/StippleJSONExt.jl index 60c953c1..6b35ec86 100644 --- a/ext/StippleJSONExt.jl +++ b/ext/StippleJSONExt.jl @@ -5,10 +5,12 @@ using JSON # garantee interoperability of different JSONTText definitions in Stipple and JSON # for both JSON3 and JSON +# Note that `lower` for Stipple.JSONText is not defined as parse(json.s), because that would require +# pure proper JSON. For transmissions of bindings, though, we need to allow to pass object names. JSON.JSONText(json::Stipple.JSONText) = JSON.JSONText(json.s) JSON.show_json(io::JSON.Writer.CompactContext, s::JSON.Writer.CS, json::Stipple.JSONText) = write(io, json.s) -JSON.Writer.lower(json::Stipple.JSONText) = JSON.parse(json.s) +JSON.Writer.lower(json::Stipple.JSONText) = json.s Stipple.JSONText(json::JSON.JSONText) = Stipple.JSONText(json.s) @inline StructTypes.StructType(::Type{JSON.JSONText}) = JSON3.RawType()