Skip to content

Commit 7815fd9

Browse files
committed
Deprecate scala.util.parsing.json
#99
1 parent 5ec6af9 commit 7815fd9

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

Diff for: shared/src/main/scala/scala/util/parsing/json/JSON.scala

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ package util.parsing.json
2828
*
2929
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
3030
*/
31+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
3132
object JSON extends Parser {
3233

3334
/**

Diff for: shared/src/main/scala/scala/util/parsing/json/Lexer.scala

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import scala.util.parsing.input.CharArrayReader.EofCh
1818
/**
1919
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
2020
*/
21+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
2122
class Lexer extends StdLexical with ImplicitConversions {
2223

2324
override def token: Parser[Token] =

Diff for: shared/src/main/scala/scala/util/parsing/json/Parser.scala

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import scala.util.parsing.combinator.syntactical._
1919
*
2020
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
2121
*/
22+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
2223
sealed abstract class JSONType {
2324
/**
2425
* This version of toString allows you to provide your own value
@@ -40,6 +41,7 @@ sealed abstract class JSONType {
4041
*
4142
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
4243
*/
44+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
4345
object JSONFormat {
4446
/**
4547
* This type defines a function that can be used to
@@ -91,6 +93,7 @@ object JSONFormat {
9193
*
9294
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
9395
*/
96+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
9497
case class JSONObject (obj : Map[String,Any]) extends JSONType {
9598
def toString (formatter : JSONFormat.ValueFormatter) =
9699
"{" + obj.map({ case (k,v) => formatter(k.toString) + " : " + formatter(v) }).mkString(", ") + "}"
@@ -100,6 +103,7 @@ case class JSONObject (obj : Map[String,Any]) extends JSONType {
100103
* Represents a JSON Array (list).
101104
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
102105
*/
106+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
103107
case class JSONArray (list : List[Any]) extends JSONType {
104108
def toString (formatter : JSONFormat.ValueFormatter) =
105109
"[" + list.map(formatter).mkString(", ") + "]"
@@ -110,6 +114,7 @@ case class JSONArray (list : List[Any]) extends JSONType {
110114
*
111115
* @author Derek Chen-Becker <"java"+@+"chen-becker"+"."+"org">
112116
*/
117+
@deprecated("Use The Scala Library Index to find alternatives: https://index.scala-lang.org/", "1.0.6")
113118
class Parser extends StdTokenParsers with ImplicitConversions {
114119
// Fill in abstract defs
115120
type Tokens = Lexer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package scala.util.parsing
2+
3+
/**
4+
* This package was never intended for production use; it's really more of a code sample demonstrating how to use parser combinators.
5+
*
6+
* Use [[https://index.scala-lang.org/ The Scala Library Index]] to find alternative JSON parsing libraries.
7+
*/
8+
package object json {}

0 commit comments

Comments
 (0)