From de47f39dea85301fb9b0ab59c80dfde56e9b76d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 5 Sep 2017 11:39:18 -0400 Subject: [PATCH] json::dynamic: remove to_parse_error redundant of to_error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/json/dynamic.nit | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/json/dynamic.nit b/lib/json/dynamic.nit index c305918..91c7a73 100644 --- a/lib/json/dynamic.nit +++ b/lib/json/dynamic.nit @@ -192,19 +192,6 @@ class JsonValue # require: `self.is_error` fun to_error: Error do return value.as(Error) - ### JsonParseError - - # Is this value a parse error? - # - # assert "[".to_json_value.is_parse_error - # assert not "[]".to_json_value.is_parse_error - fun is_parse_error: Bool do return value isa JsonParseError - - # Get this value as a `JsonParseError`. - # - # require: `self.is_parse_error` - fun to_parse_error: JsonParseError do return value.as(JsonParseError) - ### Children access # Iterator over the values of the array `self` @@ -311,7 +298,8 @@ class JsonValue # Return a human-readable description of the type. # # For debugging purpose only. - fun json_type: String do + private fun json_type: String + do if is_array then return "array" if is_bool then return "bool" if is_float then return "float" @@ -319,7 +307,6 @@ class JsonValue if is_null then return "null" if is_map then return "map" if is_string then return "string" - if is_parse_error then return "parse_error" if is_error then return "error" return "undefined" end -- 1.7.9.5