Skip to content

Commit b15341f

Browse files
author
Aleksandar Prokopec
committed
Pending test for si-5514
1 parent 6734215 commit b15341f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/pending/run/t5514.scala

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
3+
4+
import scala.io.Source
5+
import scala.util.parsing.combinator.Parsers
6+
import scala.util.parsing.input.Reader
7+
import scala.util.parsing.input.Position
8+
9+
10+
11+
object DemoApp extends App {
12+
val parsers = new DemoParsers
13+
val reader = new DemoReader(10)
14+
val result = parsers.startsWith("s").*(reader)
15+
Console println result
16+
}
17+
18+
19+
class DemoReader(n: Int) extends Reader[String] {
20+
def atEnd = n == 0
21+
def first = "s" + n
22+
def rest = new DemoReader(n - 1)
23+
def pos = new Position {
24+
def line = 0
25+
def column = 0
26+
def lineContents = first
27+
}
28+
println("reader: " + n)
29+
}
30+
31+
32+
class DemoParsers extends Parsers {
33+
type Elem = String
34+
def startsWith(prefix: String) = acceptIf(_ startsWith prefix)("Error: " + _)
35+
}

0 commit comments

Comments
 (0)