Forráskód Böngészése

20200802 src/JSON/json-util.sml (vergessen, patch/json-util.sml.patch anzuwenden)

Altlast 4 éve
szülő
commit
5ed3311ca0
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      src/JSON/json-util.sml

+ 3 - 3
src/JSON/json-util.sml

@@ -133,7 +133,7 @@ structure JSONUtil : sig
 
     fun lookupField (v as J.OBJECT fields) = let
 	  fun find lab = (case List.find (fn (l, v) => (l = lab)) fields
-		 of NONE => raise FieldNotFound(v, concat["no definition for field \"", lab, "\""])
+		 of NONE => raise FieldNotFound(v, lab)
 		  | SOME(_, v) => v
 		(* end case *))
 	  in
@@ -197,7 +197,7 @@ structure JSONUtil : sig
     fun get (v, []) = v
       | get (v as J.OBJECT fields, SEL lab :: rest) =
 	  (case List.find (fn (l, v) => (l = lab)) fields
-	   of NONE => raise raise FieldNotFound(v, concat["no definition for field \"", lab, "\""])
+	   of NONE => raise FieldNotFound(v, lab)
 	    | SOME(_, v) => get (v, rest)
 	  (* end case *))
       | get (v, SEL _ :: _) = raise NotObject v
@@ -222,7 +222,7 @@ structure JSONUtil : sig
   (* follow a path into a JSON value while constructing a zipper *)
     fun unzip (v, []) = (ZNIL, v)
       | unzip (v as J.OBJECT fields, SEL lab :: rest) = let
-          fun find (_, []) = raise FieldNotFound(v, concat["no definition for field \"", lab, "\""])
+          fun find (_, []) = raise FieldNotFound(v, lab)
             | find (pre, (l, v)::flds) = if (l = lab)
                 then let
 		  val (zipper, v) = unzip (v, rest)