diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-11-13 15:33:33 +0100 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-11-20 16:06:30 +0100 |
commit | b004c3ddb38f8e690a0895a51ad0c83ff57a01e7 (patch) | |
tree | 0c31f83d2e039db4c2ead7a3280aaabc78671333 /test/files/run/tcpoly_parseridioms.scala | |
parent | c243435f113615b2f7407fbd683c93ec16c73749 (diff) | |
download | scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.gz scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.tar.bz2 scala-b004c3ddb38f8e690a0895a51ad0c83ff57a01e7.zip |
deprecate Pair and Triple
Diffstat (limited to 'test/files/run/tcpoly_parseridioms.scala')
-rw-r--r-- | test/files/run/tcpoly_parseridioms.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/files/run/tcpoly_parseridioms.scala b/test/files/run/tcpoly_parseridioms.scala index c8bcf693a1..d22f68b558 100644 --- a/test/files/run/tcpoly_parseridioms.scala +++ b/test/files/run/tcpoly_parseridioms.scala @@ -13,10 +13,10 @@ trait Parsers { } // sequence - def sq[T, U](a: => Parser[T], b: => Parser[U]): Parser[Pair[T, U]] = new Parser[Pair[T, U]] { - def apply(in: Input): ParseResult[Pair[T, U]] = a(in) match { + def sq[T, U](a: => Parser[T], b: => Parser[U]): Parser[Tuple2[T, U]] = new Parser[Tuple2[T, U]] { + def apply(in: Input): ParseResult[Tuple2[T, U]] = a(in) match { case Success(next, x) => b(next) match { - case Success(next2, y) => Success(next2, Pair(x,y)) + case Success(next2, y) => Success(next2, (x,y)) case Failure(_, msg) => Failure(in, msg) } case Failure(_, msg) => Failure(in, msg) @@ -49,7 +49,7 @@ trait Parsers { } } - def apply_++[s, tt](fun: Parser[s => tt], arg: Parser[s]): Parser[tt] = lift[Pair[s=>tt, s], tt]({case Pair(f, a) => f(a)})(sq(fun, arg)) + def apply_++[s, tt](fun: Parser[s => tt], arg: Parser[s]): Parser[tt] = lift[Tuple2[s=>tt, s], tt]({case (f, a) => f(a)})(sq(fun, arg)) def success[u](v: u): Parser[u] = new Parser[u] { def apply(in: Input) = Success(in, v) |