nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Implementing the Nit wrapper over the native postgres wrapper
[nit.git]
/
lib
/
json
/
static.nit
diff --git
a/lib/json/static.nit
b/lib/json/static.nit
index
7c0e2cf
..
e333b85
100644
(file)
--- a/
lib/json/static.nit
+++ b/
lib/json/static.nit
@@
-31,6
+31,9
@@
private import json_lexer
interface Jsonable
# Encode `self` in JSON.
#
interface Jsonable
# Encode `self` in JSON.
#
+ # This is a recursive method which can be refined by any subclasses.
+ # To write any `Serializable` object to JSON, see `serialize_to_json`.
+ #
# SEE: `append_json`
fun to_json: String is abstract
# SEE: `append_json`
fun to_json: String is abstract
@@
-439,6
+442,11
@@
redef class JsonParseError
"\"position\":{position.to_json}," +
"\"message\":{message.to_json}\}"
end
"\"position\":{position.to_json}," +
"\"message\":{message.to_json}\}"
end
+
+ redef fun pretty_json_visit(buf, indents) do
+ buf.clear
+ buf.append(to_json)
+ end
end
redef class Position
end
redef class Position