Skip to content

Commit

Permalink
no parsing of jsontext in lower()
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Oct 13, 2023
1 parent cfa93c3 commit 1dbb1a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/StippleJSON.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion ext/StippleJSONExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1dbb1a8

Please sign in to comment.