パーサコンビネータの処理が終わってくれない!!

パーサコンビネータの勉強も兼ねて、ScalaでWikiエンジンを作ろうと思ってます。

パーサコンビネータでいろいろ試していますが、以下のコードは、私の環境では処理が終わってくれません。
なんでだろう・・・。

import scala.util.parsing.combinator.RegexParsers

case class Indent(i: Int)
case class Text(s: String)
case class Line(i: Indent, t: Text)

object Parser extends RegexParsers {

  def indent: Parser[Indent] = """^\s*""".r ^^ {in => Indent(in.length)}
  def text: Parser[Text] = """[^\n\r]*""".r ^^ {s => Text(s)}
  def eol = """\n?\r?""".r

  def line: Parser[Line] = indent ~ (text <~ eol) ^^ {case in ~ te => Line(in, te)}

  def parse(s: String) = parseAll(rep(line), s)
 
}

object Main extends App {
  val s = """  hoge\n  fuga"""
  
  // 自分の環境では、この処理は終わらない。
  // 戻り値は List(Line(Indent(2), Text(hoge)), Line(Indent(2), Text(fuga))) を想定しているが・・・
  Parser.parse(s)
}

とりあえずやりたいことは、

  • indent で行頭のスペースの数を取得したい
  • text で本文を取得したい
  • eof で行を区切る

なのですが、うまく処理が終わってくれません。