@tailrec def update(toks: List[Token], result: List[String]): String = {
toks match { case tok :: rest if tok.source == "--" || tok.source == Symbol.comment =>
rest.dropWhile(_.is_space) match { case tok1 :: rest1 if tok1.is_embedded =>
update(rest1, make_comment(tok1) :: result) case _ => update(rest, tok.source :: result)
} case tok :: rest if tok.is_formal_comment && tok.source.startsWith(Symbol.comment) =>
update(rest, make_comment(tok) :: result) case tok :: rest => update(rest, tok.source :: result) case Nil => result.reverse.mkString
}
}
val text0 = File.read(path) val text1 = update(Token.explode(Keyword.Keywords.empty, text0), Nil)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.