From 887f9515f70ffe560b06cfdd32d1fadfc0ba9bb1 Mon Sep 17 00:00:00 2001 From: michelou Date: Mon, 9 Jul 2007 11:11:29 +0000 Subject: added @deprecated annotation --- .../util/parsing/CharInputStreamIterator.scala | 21 +++++++++++++-------- src/library/scala/util/parsing/Parsers.scala | 6 +++++- .../scala/util/parsing/SimpleTokenizer.scala | 10 +++++++--- 3 files changed, 25 insertions(+), 12 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/util/parsing/CharInputStreamIterator.scala b/src/library/scala/util/parsing/CharInputStreamIterator.scala index 476bf45d18..b58650e025 100644 --- a/src/library/scala/util/parsing/CharInputStreamIterator.scala +++ b/src/library/scala/util/parsing/CharInputStreamIterator.scala @@ -19,28 +19,33 @@ import java.io.{IOException, EOFException} * * @author Burak Emir * @version 1.0 - * @deprecated use classes from scala.util.parsing.input instead + * + * @deprecated use classes from + * scala.util.parsing.input instead. */ +@deprecated class CharInputStreamIterator(in: InputStream) extends Iterator[Char] { private var ch: Int = _ private var chSet = false private var error: IOException = null - private def lookahead(): Unit = try { - ch = in.read(); chSet = ch >= 0 - } catch { - case ex: EOFException => ch = -1 - case ex: IOException => ch = 1; error = ex + private def lookahead() { + try { + ch = in.read(); chSet = ch >= 0 + } catch { + case ex: EOFException => ch = -1 + case ex: IOException => ch = 1; error = ex + } } def hasNext: Boolean = { - if (!chSet) lookahead + if (!chSet) lookahead() chSet } def next(): Char = { - if (!chSet) lookahead + if (!chSet) lookahead() chSet = false ch.asInstanceOf[Char] } diff --git a/src/library/scala/util/parsing/Parsers.scala b/src/library/scala/util/parsing/Parsers.scala index cfd56b218a..9124c624ab 100644 --- a/src/library/scala/util/parsing/Parsers.scala +++ b/src/library/scala/util/parsing/Parsers.scala @@ -17,8 +17,12 @@ package scala.util.parsing * * @author Burak Emir * @version 1.0 - * @deprecated use scala.util.parsing.combinator.Parsers instead + * + * @deprecated use + * scala.util.parsing.combinator.Parsers + * instead. */ +@deprecated abstract class Parsers { type inputType diff --git a/src/library/scala/util/parsing/SimpleTokenizer.scala b/src/library/scala/util/parsing/SimpleTokenizer.scala index 5103e6897d..52e921f351 100644 --- a/src/library/scala/util/parsing/SimpleTokenizer.scala +++ b/src/library/scala/util/parsing/SimpleTokenizer.scala @@ -15,8 +15,12 @@ package scala.util.parsing * * @author Burak Emir * @version 1.0 - * @deprecated use scala.util.parsing.combinator.lexical.StdLexical instead + * + * @deprecated use + * scala.util.parsing.combinator.lexical.StdLexical + * instead. */ +@deprecated class SimpleTokenizer(in: Iterator[Char], delimiters: String) extends Iterator[String] { private def max(x: Int, y: Char): Int = if (x > y) x else y @@ -26,7 +30,7 @@ class SimpleTokenizer(in: Iterator[Char], delimiters: String) extends Iterator[S private def delimArray: Array[Boolean] = { val ds = List.fromString(delimiters) val da = new Array[Boolean]((0 /: ds)(max) + 1) - for (ch <- ds) { da(ch) = true } + for (ch <- ds) da(ch) = true da } @@ -47,7 +51,7 @@ class SimpleTokenizer(in: Iterator[Char], delimiters: String) extends Iterator[S while (ch <= ' ' && ch != EOI) ch = nextChar() if (ch == EOI) "" else { - buf.setLength(0) + buf setLength 0 if (isDelimiter(ch)) { buf append ch.asInstanceOf[Char]; ch = nextChar() } else { -- cgit v1.2.3