Skip to content

Commit 8045d83

Browse files
PackratParsers: workaround for scala/scala-parser-combinators#318
1 parent 43b20c5 commit 8045d83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/scala/util/packrat.scala

+4-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ to update each parser involved in the recursion.
235235
/*
236236
* transformed reader
237237
*/
238-
val inMem = in.asInstanceOf[PackratReader[Elem]]
238+
val inMem: PackratReader[Elem] = in match {
239+
case in: PackratReader[_] => in.asInstanceOf[PackratReader[Elem]]
240+
case in => new PackratReader(in)
241+
}
239242

240243
//look in the global cache if in a recursion
241244
val m = recall(p, inMem)

0 commit comments

Comments
 (0)