author | wenzelm |
Wed, 22 Feb 2023 21:35:28 +0100 | |
changeset 77347 | 739a9c34c538 |
parent 77346 | cf2ef4be3630 |
child 77348 | 885842575e2a |
--- a/src/Pure/General/json.scala Wed Feb 22 21:31:36 2023 +0100 +++ b/src/Pure/General/json.scala Wed Feb 22 21:35:28 2023 +0100 @@ -33,6 +33,9 @@ Some(m.asInstanceOf[Object.T]) case _ => None } + + def parse(s: S): Object.T = + unapply(JSON.parse(s)).getOrElse(error("Bad JSON object " + quote(s))) }