Skip to content

Commit

Permalink
fix #400
Browse files Browse the repository at this point in the history
  • Loading branch information
tminglei committed Apr 4, 2018
1 parent d3469f4 commit 66fb70e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PgPlayJsonSupportSuite extends FunSuite {

//------------------------------------------------------------------------------

val testRec1 = JsonBean(33L, Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """), List(Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """)),
val testRec1 = JsonBean(33L, Json.parse(""" { "a":101, "b":"aaa", "c":[3,4,5,9] } """), List(Json.parse(""" { "a":101, "b":"", "c":[3,4,5,9] } """)),
JBean("tt", 3), List(JBean("tt", 3)))
val testRec2 = JsonBean(35L, Json.parse(""" [ {"a":"v1","b":2}, {"a":"v5","b":3} ] """), List(Json.parse(""" [ {"a":"v1","b":2}, {"a":"v5","b":3} ] """)),
JBean("t1", 5), List(JBean("t1", 5)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ object PgTokenHelper {
}
//-- process marker tokens
// mark + mark (empty string)
case Marker(m) if (m != "" && level(m) == stack.top.level + 2) =>
stack.top.tokens += Chunk("")
case Marker(m) if (m != "" && level(m) == stack.top.level + 2) => {
val m2 = m.substring(0, m.length / 2)
stack.top.tokens += GroupToken(List(Marker(m2), Chunk(""), Marker(m2)))
}
// mark + escape
case Marker(m) if (m != "" && level(m) != math.round(level(m))
&& (tokens(i-1) == Comma || tokens(i-1).isInstanceOf[Open])) => {
Expand Down

0 comments on commit 66fb70e

Please sign in to comment.