summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/util/parsing/json/Lexer.scala2
-rw-r--r--test/files/run/json.check1
-rw-r--r--test/files/run/json.scala1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/util/parsing/json/Lexer.scala b/src/library/scala/util/parsing/json/Lexer.scala
index 289551fe0b..c44e290797 100644
--- a/src/library/scala/util/parsing/json/Lexer.scala
+++ b/src/library/scala/util/parsing/json/Lexer.scala
@@ -43,7 +43,7 @@ class Lexer extends StdLexical with ImplicitConversions {
/** A string is a collection of zero or more Unicode characters, wrapped in
* double quotes, using backslash escapes (cf. http://www.json.org/).
*/
- def string = '\"' ~ rep(chrExcept('\"', '\n', EofCh)) ~ '\"' ^^ { _ mkString "" }
+ def string = '\"' ~ rep(charSeq | chrExcept('\"', '\n', EofCh)) ~ '\"' ^^ { _ mkString "" }
override def whitespace = rep(whitespaceChar)
diff --git a/test/files/run/json.check b/test/files/run/json.check
index 4c2dbf48a0..2a3f25166a 100644
--- a/test/files/run/json.check
+++ b/test/files/run/json.check
@@ -1,6 +1,7 @@
Some(List((name,value)))
Some(List((name,va1ue)))
Some(List((name,List((name1,va1ue1), (name2,va1ue2)))))
+Some(List((name,")))
Some(List((firstName,John), (lastName,Smith), (address,List((streetAddress,21 2nd Street), (city,New York), (state,NY), (postalCode,10021.0))), (phoneNumbers,List(212 732-1234, 646 123-4567))))
diff --git a/test/files/run/json.scala b/test/files/run/json.scala
index 040dbd380e..3cb8e3963b 100644
--- a/test/files/run/json.scala
+++ b/test/files/run/json.scala
@@ -7,6 +7,7 @@ object Test extends Application {
printJSON("{\"name\": \"value\"}")
printJSON("{\"name\": \"va1ue\"}") // ticket #136
printJSON("{\"name\": { \"name1\": \"va1ue1\", \"name2\": \"va1ue2\" } }")
+ printJSON("{\"name\": \"\\u0022\"}")
println
// from http://en.wikipedia.org/wiki/JSON