diff options
Diffstat (limited to 'src/library')
58 files changed, 457 insertions, 466 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index 5ff5778800..c8f61d0625 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -422,7 +422,7 @@ object Array extends FallbackArrayBuilding { * @param elem the element composing the resulting array * @return an array composed of n elements all equal to elem */ - @deprecated("use `Array.fill' instead", "2.8.0") + @deprecated("use `Array.fill` instead", "2.8.0") def make[T: ClassManifest](n: Int, elem: T): Array[T] = { val a = new Array[T](n) var i = 0 @@ -436,7 +436,7 @@ object Array extends FallbackArrayBuilding { /** Creates an array containing the values of a given function `f` * over given range `[0..n)` */ - @deprecated("use `Array.tabulate' instead", "2.8.0") + @deprecated("use `Array.tabulate` instead", "2.8.0") def fromFunction[T: ClassManifest](f: Int => T)(n: Int): Array[T] = { val a = new Array[T](n) var i = 0 @@ -450,28 +450,28 @@ object Array extends FallbackArrayBuilding { /** Creates an array containing the values of a given function `f` * over given range `[0..n1, 0..n2)` */ - @deprecated("use `Array.tabulate' instead", "2.8.0") + @deprecated("use `Array.tabulate` instead", "2.8.0") def fromFunction[T: ClassManifest](f: (Int, Int) => T)(n1: Int, n2: Int): Array[Array[T]] = fromFunction(i => fromFunction(f(i, _))(n2))(n1) /** Creates an array containing the values of a given function `f` * over given range `[0..n1, 0..n2, 0..n3)` */ - @deprecated("use `Array.tabulate' instead", "2.8.0") + @deprecated("use `Array.tabulate` instead", "2.8.0") def fromFunction[T: ClassManifest](f: (Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int): Array[Array[Array[T]]] = fromFunction(i => fromFunction(f(i, _, _))(n2, n3))(n1) /** Creates an array containing the values of a given function `f` * over given range `[0..n1, 0..n2, 0..n3, 0..n4)` */ - @deprecated("use `Array.tabulate' instead", "2.8.0") + @deprecated("use `Array.tabulate` instead", "2.8.0") def fromFunction[T: ClassManifest](f: (Int, Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[T]]]] = fromFunction(i => fromFunction(f(i, _, _, _))(n2, n3, n4))(n1) /** Creates an array containing the values of a given function `f` * over given range `[0..n1, 0..n2, 0..n3, 0..n4, 0..n5)` */ - @deprecated("use `Array.tabulate' instead", "2.8.0") + @deprecated("use `Array.tabulate` instead", "2.8.0") def fromFunction[T: ClassManifest](f: (Int, Int, Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[T]]]]] = fromFunction(i => fromFunction(f(i, _, _, _, _))(n2, n3, n4, n5))(n1) } @@ -485,56 +485,56 @@ object Array extends FallbackArrayBuilding { final class Array[T](_length: Int) extends java.io.Serializable with java.lang.Cloneable { /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = { this(dim1); throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = { this(dim1) throw new Error() } /** Multidimensional array creation */ - @deprecated("use `Array.ofDim' instead", "2.8.0") + @deprecated("use `Array.ofDim` instead", "2.8.0") def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = { this(dim1) throw new Error() diff --git a/src/library/scala/DelayedInit.scala b/src/library/scala/DelayedInit.scala index ab9741fc9f..7381be7f83 100644 --- a/src/library/scala/DelayedInit.scala +++ b/src/library/scala/DelayedInit.scala @@ -1,8 +1,9 @@ package scala /** Classes and traits inheriting the `DelayedInit` marker trait - * will have their initialization code rewritten as follows. - * <code> becomes delayedInit(<code>) + * will have their initialization code rewritten as follows: + * `code` becomes `delayedInit(code)` + * * Initialization code comprises all statements and all value definitions * that are executed during initialization. */ diff --git a/src/library/scala/Math.scala b/src/library/scala/Math.scala index b8493185a2..94620a0388 100644 --- a/src/library/scala/Math.scala +++ b/src/library/scala/Math.scala @@ -13,83 +13,83 @@ package scala * operations such as the elementary exponential, logarithm, square root, and * trigonometric functions. */ -@deprecated("use the scala.math package object instead.\n(Example package object usage: scala.math.Pi )", "2.8.0") +@deprecated("use the [[scala.math]] package object instead.\n(Example package object usage: `scala.math.Pi`)", "2.8.0") object Math extends MathCommon { - @deprecated("Use scala.Byte.MinValue instead", "2.8.0") + @deprecated("Use `scala.Byte.MinValue` instead", "2.8.0") val MIN_BYTE = java.lang.Byte.MIN_VALUE - @deprecated("Use scala.Byte.MaxValue instead", "2.8.0") + @deprecated("Use `scala.Byte.MaxValue` instead", "2.8.0") val MAX_BYTE = java.lang.Byte.MAX_VALUE - @deprecated("Use scala.Short.MinValue instead", "2.8.0") + @deprecated("Use `scala.Short.MinValue` instead", "2.8.0") val MIN_SHORT = java.lang.Short.MIN_VALUE - @deprecated("Use scala.Short.MaxValue instead", "2.8.0") + @deprecated("Use `scala.Short.MaxValue` instead", "2.8.0") val MAX_SHORT = java.lang.Short.MAX_VALUE - @deprecated("Use scala.Char.MinValue instead", "2.8.0") + @deprecated("Use `scala.Char.MinValue` instead", "2.8.0") val MIN_CHAR = java.lang.Character.MIN_VALUE - @deprecated("Use scala.Char.MaxValue instead", "2.8.0") + @deprecated("Use `scala.Char.MaxValue` instead", "2.8.0") val MAX_CHAR = java.lang.Character.MAX_VALUE - @deprecated("Use scala.Int.MinValue instead", "2.8.0") + @deprecated("Use `scala.Int.MinValue` instead", "2.8.0") val MIN_INT = java.lang.Integer.MIN_VALUE - @deprecated("Use scala.Int.MaxValue instead", "2.8.0") + @deprecated("Use `scala.Int.MaxValue` instead", "2.8.0") val MAX_INT = java.lang.Integer.MAX_VALUE - @deprecated("Use scala.Long.MinValue instead", "2.8.0") + @deprecated("Use `scala.Long.MinValue` instead", "2.8.0") val MIN_LONG = java.lang.Long.MIN_VALUE - @deprecated("Use scala.Long.MaxValue instead", "2.8.0") + @deprecated("Use `scala.Long.MaxValue` instead", "2.8.0") val MAX_LONG = java.lang.Long.MAX_VALUE - /** The smallest possible value for <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.MinValue instead", "2.8.0") + /** The smallest possible value for [[scala.Float]]. */ + @deprecated("Use `scala.Float.MinValue` instead", "2.8.0") val MIN_FLOAT = -java.lang.Float.MAX_VALUE - /** The smallest difference between two values of <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.MinPositiveValue instead", "2.8.0") + /** The smallest difference between two values of [[scala.Float]]. */ + @deprecated("Use `scala.Float.MinPositiveValue` instead", "2.8.0") val EPS_FLOAT = java.lang.Float.MIN_VALUE - /** The greatest possible value for <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.MaxValue instead", "2.8.0") + /** The greatest possible value for [[scala.Float]]. */ + @deprecated("Use `scala.Float.MaxValue` instead", "2.8.0") val MAX_FLOAT = java.lang.Float.MAX_VALUE - /** A value of type <a href="Float.html" target="_self">scala.Float</a> that represents no number. */ - @deprecated("Use scala.Float.NaN instead", "2.8.0") + /** A value of type [[scala.Float]] that represents no number. */ + @deprecated("Use `scala.Float.NaN` instead", "2.8.0") val NaN_FLOAT = java.lang.Float.NaN - /** Negative infinity of type <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.NegativeInfinity instead", "2.8.0") + /** Negative infinity of type [[scala.Float]]. */ + @deprecated("Use `scala.Float.NegativeInfinity` instead", "2.8.0") val NEG_INF_FLOAT = java.lang.Float.NEGATIVE_INFINITY - /** Positive infinity of type <a href="Float.html" target="_self">scala.Float</a>. */ - @deprecated("Use scala.Float.PositiveInfinity instead", "2.8.0") + /** Positive infinity of type [[scala.Float]]. */ + @deprecated("Use `scala.Float.PositiveInfinity` instead", "2.8.0") val POS_INF_FLOAT = java.lang.Float.POSITIVE_INFINITY - /** The smallest possible value for <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.MinValue instead", "2.8.0") + /** The smallest possible value for [[scala.Double]]. */ + @deprecated("Use `scala.Double.MinValue` instead", "2.8.0") val MIN_DOUBLE = -java.lang.Double.MAX_VALUE - /** The smallest difference between two values of <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.MinPositiveValue instead", "2.8.0") + /** The smallest difference between two values of [[scala.Double]]. */ + @deprecated("Use `scala.Double.MinPositiveValue` instead", "2.8.0") val EPS_DOUBLE = java.lang.Double.MIN_VALUE - /** The greatest possible value for <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.MaxValue instead", "2.8.0") + /** The greatest possible value for [[scala.Double]]. */ + @deprecated("Use `scala.Double.MaxValue` instead", "2.8.0") val MAX_DOUBLE = java.lang.Double.MAX_VALUE - /** A value of type <a href="Double.html" target="_self">scala.Double</a> that represents no number. */ - @deprecated("Use scala.Double.NaN instead", "2.8.0") + /** A value of type [[scala.Double]] that represents no number. */ + @deprecated("Use `scala.Double.NaN` instead", "2.8.0") val NaN_DOUBLE = java.lang.Double.NaN - /** Negative infinity of type <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.NegativeInfinity instead", "2.8.0") + /** Negative infinity of type [[scala.Double]]. */ + @deprecated("Use `scala.Double.NegativeInfinity` instead", "2.8.0") val NEG_INF_DOUBLE = java.lang.Double.NEGATIVE_INFINITY - /** Positive infinity of type <a href="Double.html" target="_self">scala.Double</a>. */ - @deprecated("Use scala.Double.PositiveInfinity instead", "2.8.0") + /** Positive infinity of type [[scala.Double]]. */ + @deprecated("Use `scala.Double.PositiveInfinity` instead", "2.8.0") val POS_INF_DOUBLE = java.lang.Double.POSITIVE_INFINITY }
\ No newline at end of file diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index 55c12b8e8c..b64daa8df9 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -55,8 +55,7 @@ self => override protected[this] def thisCollection: Iterable[A] = this.asInstanceOf[Iterable[A]] override protected[this] def toCollection(repr: Repr): Iterable[A] = repr.asInstanceOf[Iterable[A]] - /** Creates a new iterator over all elements contained in this - * iterable object. + /** Creates a new iterator over all elements contained in this iterable object. * * @return the new iterator */ @@ -298,20 +297,22 @@ self => override /*TraversableLike*/ def view(from: Int, until: Int) = view.slice(from, until) - @deprecated("use `iterator' instead", "2.8.0") + @deprecated("use `iterator` instead", "2.8.0") def elements = iterator - @deprecated("use `head' instead", "2.8.0") def first: A = head + @deprecated("use `head` instead", "2.8.0") + def first: A = head /** `None` if iterable is empty. */ - @deprecated("use `headOption' instead", "2.8.0") def firstOption: Option[A] = headOption + @deprecated("use `headOption` instead", "2.8.0") + def firstOption: Option[A] = headOption /** * returns a projection that can be used to call non-strict `filter`, * `map`, and `flatMap` methods that build projections * of the collection. */ - @deprecated("use `view' instead", "2.8.0") + @deprecated("use `view` instead", "2.8.0") def projection = view } diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index f7f8e7a971..b334320060 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -12,8 +12,7 @@ import mutable.ArrayBuffer import annotation.{ tailrec, migration } import immutable.Stream -/** The `Iterator` object provides various functions for - * creating specialized iterators. +/** The `Iterator` object provides various functions for creating specialized iterators. * * @author Martin Odersky * @author Matthias Zenger @@ -22,7 +21,7 @@ import immutable.Stream */ object Iterator { - /** The iterator which produces no values */ + /** The iterator which produces no values. */ val empty = new Iterator[Nothing] { def hasNext: Boolean = false def next(): Nothing = throw new NoSuchElementException("next on empty iterator") @@ -30,6 +29,7 @@ object Iterator { /** Creates an iterator which produces a single element. * '''Note:''' Equivalent, but more efficient than Iterator(elem) + * * @param elem the element * @return An iterator which produces `elem` on the first call to `next`, * and which has no further elements. @@ -42,15 +42,16 @@ object Iterator { else empty.next() } - /** Creates an iterator with given elements + /** Creates an iterator with given elements. + * * @param elems The elements returned one-by-one from the iterator * @return An iterator which produces the given elements on the * first calls to `next`, and which has no further elements. */ def apply[A](elems: A*): Iterator[A] = elems.iterator - /** Creates iterator that produces the results of some element computation - * a number of times. + /** Creates iterator that produces the results of some element computation a number of times. + * * @param n the number of elements returned by the iterator. * @param elem the element computation * @return An iterator that produces the results of `n` evaluations of `elem`. @@ -64,6 +65,7 @@ object Iterator { } /** Creates an iterator producing the values of a given function over a range of integer values starting from 0. + * * @param n The number of elements returned by the iterator * @param f The function computing element values * @return An iterator that produces the values `f(0), ..., f(n -1)`. @@ -137,8 +139,8 @@ object Iterator { def next(): Int = { val result = i; i += step; result } } - /** Creates an infinite-length iterator returning the results of evaluating - * an expression. The expression is recomputed for every element. + /** Creates an infinite-length iterator returning the results of evaluating an expression. + * The expression is recomputed for every element. * * @param elem the element computation. * @return the iterator containing an infinite number of results of evaluating `elem`. @@ -148,13 +150,13 @@ object Iterator { def next = elem } - @deprecated("use `xs.iterator' or `Iterator(xs)' instead", "2.8.0") + @deprecated("use `xs.iterator` or `Iterator(xs)` instead", "2.8.0") def fromValues[a](xs: a*) = xs.iterator /** @param xs the array of elements * @see also: IndexedSeq.iterator and slice */ - @deprecated("use `xs.iterator' instead", "2.8.0") + @deprecated("use `xs.iterator` instead", "2.8.0") def fromArray[a](xs: Array[a]): Iterator[a] = fromArray(xs, 0, xs.length) @@ -164,7 +166,7 @@ object Iterator { * @param length the length * @see also: IndexedSeq.iterator and slice */ - @deprecated("use `xs.slice(start, start + length).iterator' instead", "2.8.0") + @deprecated("use `xs.slice(start, start + length).iterator` instead", "2.8.0") def fromArray[a](xs: Array[a], start: Int, length: Int): Iterator[a] = xs.slice(start, start + length).iterator @@ -172,7 +174,7 @@ object Iterator { * @param n the product arity * @return the iterator on `Product<n>`. */ - @deprecated("use product.productIterator instead", "2.8.0") + @deprecated("use `product.productIterator instead`", "2.8.0") def fromProduct(n: Product): Iterator[Any] = new Iterator[Any] { private var c: Int = 0 private val cmax = n.productArity @@ -180,18 +182,15 @@ object Iterator { def next() = { val a = n productElement c; c += 1; a } } - /** Create an iterator with elements - * `e<sub>n+1</sub> = step(e<sub>n</sub>)` - * where `e<sub>0</sub> = start` - * and elements are in the range between `start` (inclusive) - * and `end` (exclusive) + /** Create an iterator with elements `e<sub>n+1</sub> = step(e<sub>n</sub>)` where `e<sub>0</sub> = start` + * and elements are in the range between `start` (inclusive) and `end` (exclusive). * * @param start the start value of the iterator * @param end the end value of the iterator * @param step the increment function of the iterator, must be monotonically increasing or decreasing * @return the iterator with values in range `[start;end)`. */ - @deprecated("use Iterator.iterate(start, end - start)(step) instead", "2.8.0") + @deprecated("use `Iterator.iterate(start, end - start)(step)` instead", "2.8.0") def range(start: Int, end: Int, step: Int => Int) = new Iterator[Int] { private val up = step(start) > start private val down = step(start) < start @@ -202,27 +201,25 @@ object Iterator { else empty.next() } - /** Create an iterator with elements - * `e<sub>n+1</sub> = step(e<sub>n</sub>)` - * where `e<sub>0</sub> = start`. + /** Create an iterator with elements `e<sub>n+1</sub> = step(e<sub>n</sub>)` where `e<sub>0</sub> = start`. * * @param start the start value of the iterator * @param step the increment function of the iterator * @return the iterator starting at value `start`. */ - @deprecated("use iterate(start)(step) instead", "2.8.0") + @deprecated("use `iterate(start)(step)` instead", "2.8.0") def from(start: Int, step: Int => Int): Iterator[Int] = new Iterator[Int] { private var i = start override def hasNext: Boolean = true def next(): Int = { val j = i; i = step(i); j } } - /** Create an iterator that is the concatenation of all iterators - * returned by a given iterator of iterators. - * @param its The iterator which returns on each call to next - * a new iterator whose elements are to be concatenated to the result. + /** Create an iterator that is the concatenation of all iterators returned by a given iterator of iterators. + * + * @param its The iterator which returns on each call to next + * a new iterator whose elements are to be concatenated to the result. */ - @deprecated("use its.flatten instead", "2.8.0") + @deprecated("use `its.flatten` instead", "2.8.0") def flatten[T](its: Iterator[Iterator[T]]): Iterator[T] = new Iterator[T] { private var cur = its.next def hasNext: Boolean = { @@ -255,23 +252,27 @@ trait Iterator[+A] extends TraversableOnce[A] { def seq: Iterator[A] = this /** Tests whether this iterator can provide another element. + * * @return `true` if a subsequent call to `next` will yield an element, * `false` otherwise. */ def hasNext: Boolean /** Produces the next element of this iterator. + * * @return the next element of this iterator, if `hasNext` is `true`, * undefined behavior otherwise. */ def next(): A /** Tests whether this iterator is empty. + * * @return `true` if hasNext is false, `false` otherwise. */ def isEmpty: Boolean = !hasNext /** Tests whether this Iterator can be repeatedly traversed. + * * @return `false` */ def isTraversableAgain = false @@ -283,14 +284,14 @@ trait Iterator[+A] extends TraversableOnce[A] { def hasDefiniteSize = isEmpty /** Selects first ''n'' values of this iterator. + * * @param n the number of values to take * @return an iterator producing only of the first `n` values of this iterator, or else the * whole iterator, if it produces fewer than `n` values. */ def take(n: Int): Iterator[A] = slice(0, n) - /** Advances this iterator past the first ''n'' elements, - * or the length of the iterator, whichever is smaller. + /** Advances this iterator past the first ''n'' elements, or the length of the iterator, whichever is smaller. * * @param n the number of elements to drop * @return an iterator which produces all values of the current iterator, except @@ -299,6 +300,7 @@ trait Iterator[+A] extends TraversableOnce[A] { def drop(n: Int): Iterator[A] = slice(n, Int.MaxValue) /** Creates an iterator returning an interval of the values produced by this iterator. + * * @param from the index of the first element in this iterator which forms part of the slice. * @param until the index of the first element following the slice. * @return an iterator which advances this iterator past the first `from` elements using `drop`, @@ -326,6 +328,7 @@ trait Iterator[+A] extends TraversableOnce[A] { /** Creates a new iterator that maps all produced values of this iterator * to new values using a transformation function. + * * @param f the transformation function * @return a new iterator which transforms every value produced by this * iterator by applying the function `f` to it. @@ -336,6 +339,7 @@ trait Iterator[+A] extends TraversableOnce[A] { } /** Concatenates this iterator with another. + * * @param that the other iterator * @return a new iterator that first yields the values produced by this * iterator followed by the values produced by iterator `that`. @@ -372,9 +376,8 @@ trait Iterator[+A] extends TraversableOnce[A] { def next(): B = (if (hasNext) cur else empty).next() } - /** Returns an iterator over all the elements of this iterator that - * satisfy the predicate `p`. The order of the elements - * is preserved. + /** Returns an iterator over all the elements of this iterator that satisfy the predicate `p`. + * The order of the elements is preserved. * * @param p the predicate used to test values. * @return an iterator which produces those values of this iterator which satisfy the predicate `p`. @@ -1033,7 +1036,7 @@ trait Iterator[+A] extends TraversableOnce[A] { /** Returns a counted iterator from this iterator. */ - @deprecated("use zipWithIndex in Iterator", "2.8.0") + @deprecated("use `zipWithIndex` in `Iterator`", "2.8.0") def counted = new CountedIterator[A] { private var cnt = 0 def count = cnt @@ -1050,7 +1053,7 @@ trait Iterator[+A] extends TraversableOnce[A] { * @param start the starting index. * @param sz the maximum number of elements to be read. */ - @deprecated("use copyToArray instead", "2.8.0") + @deprecated("use `copyToArray` instead", "2.8.0") def readInto[B >: A](xs: Array[B], start: Int, sz: Int) { var i = start while (hasNext && i - start < sz) { @@ -1059,7 +1062,7 @@ trait Iterator[+A] extends TraversableOnce[A] { } } - @deprecated("use copyToArray instead", "2.8.0") + @deprecated("use `copyToArray` instead", "2.8.0") def readInto[B >: A](xs: Array[B], start: Int) { readInto(xs, start, xs.length - start) } diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala index 92be57aa89..f6a5c57ddf 100644 --- a/src/library/scala/collection/MapLike.scala +++ b/src/library/scala/collection/MapLike.scala @@ -248,7 +248,7 @@ self => def get(key: A) = self.get(key).map(f) } - @deprecated("use `mapValues' instead", "2.8.0") + @deprecated("use `mapValues` instead", "2.8.0") def mapElements[C](f: B => C) = mapValues(f) // The following 5 operations (updated, two times +, two times ++) should really be diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index 37caf82027..08db419c03 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -290,7 +290,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] with GenSeqLike[A, Repr] */ def reverseIterator: Iterator[A] = toCollection(reverse).iterator - @deprecated("use `reverseIterator' instead", "2.8.0") + @deprecated("use `reverseIterator` instead", "2.8.0") def reversedElements = reverseIterator def startsWith[B](that: GenSeq[B], offset: Int): Boolean = { @@ -687,7 +687,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] with GenSeqLike[A, Repr] * <code>map</code>, and <code>flatMap</code> methods that build projections * of the collection. */ - @deprecated("use `view' instead", "2.8.0") + @deprecated("use `view` instead", "2.8.0") override def projection = view } diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index 84fe4bdf4c..01619b0ab0 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -124,7 +124,7 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { * @param pf the partial function * @return an option value containing pf applied to the first * value for which it is defined, or `None` if none exists. - * @example `Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)` + * @example `Seq("a", 1, 5L).collectFirst({ case x: Int => x*10 }) = Some(10)` */ def collectFirst[B](pf: PartialFunction[A, B]): Option[B] = { for (x <- self.toIterator) { // make sure to use an iterator or `seq` @@ -266,10 +266,9 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { def mkString: String = mkString("") - /** Appends all elements of this $coll to a string builder using start, end, - * and separator strings. - * The written text begins with the string `start` and ends with the string - * `end`. Inside, the string representations (w.r.t. the method `toString`) + /** Appends all elements of this $coll to a string builder using start, end, and separator strings. + * The written text begins with the string `start` and ends with the string `end`. + * Inside, the string representations (w.r.t. the method `toString`) * of all elements of this $coll are separated by the string `sep`. * * @param b the string builder to which elements are appended. @@ -297,10 +296,9 @@ trait TraversableOnce[+A] extends GenTraversableOnce[A] { b } - /** Appends all elements of this $coll to a string builder using a separator - * string. The written text consists of the string representations (w.r.t. - * the method `toString`) of all elements of this $coll, separated by the - * string `sep`. + /** Appends all elements of this $coll to a string builder using a separator string. + * The written text consists of the string representations (w.r.t. the method `toString`) + * of all elements of this $coll, separated by the string `sep`. * * @param b the string builder to which elements are appended. * @param sep the separator string. diff --git a/src/library/scala/collection/TraversableView.scala b/src/library/scala/collection/TraversableView.scala index 3fad7d462d..99d3551275 100644 --- a/src/library/scala/collection/TraversableView.scala +++ b/src/library/scala/collection/TraversableView.scala @@ -24,7 +24,7 @@ object TraversableView { class NoBuilder[A] extends Builder[A, Nothing] { def +=(elem: A): this.type = this def iterator: Iterator[A] = Iterator.empty - @deprecated("use `iterator' instead", "2.8.0") + @deprecated("use `iterator` instead", "2.8.0") def elements = iterator def result() = throw new UnsupportedOperationException("TraversableView.Builder.result") def clear() {} diff --git a/src/library/scala/collection/generic/GenericCompanion.scala b/src/library/scala/collection/generic/GenericCompanion.scala index 353ab9980f..b36a1e297f 100644 --- a/src/library/scala/collection/generic/GenericCompanion.scala +++ b/src/library/scala/collection/generic/GenericCompanion.scala @@ -11,7 +11,7 @@ package generic import mutable.Builder -/** A template class for companion objects of ``regular'' collection classes +/** A template class for companion objects of "regular" collection classes * represent an unconstrained higher-kinded type. Typically * such classes inherit from trait `GenericTraversableTemplate`. * @tparam CC The type constructor representing the collection class. diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index ea0bc7523c..5446b25888 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -250,7 +250,7 @@ sealed abstract class List[+A] extends LinearSeq[A] @deprecated("use `span { x => !p(x) }` instead", "2.8.0") def break(p: A => Boolean): (List[A], List[A]) = span { x => !p(x) } - @deprecated("use `filterNot' instead", "2.8.0") + @deprecated("use `filterNot` instead", "2.8.0") def remove(p: A => Boolean): List[A] = filterNot(p) /** Computes the difference between this list and the given list @@ -289,10 +289,10 @@ sealed abstract class List[+A] extends LinearSeq[A] b.toList } - @deprecated("use `distinct' instead", "2.8.0") + @deprecated("use `distinct` instead", "2.8.0") def removeDuplicates: List[A] = distinct - @deprecated("use `sortWith' instead", "2.8.0") + @deprecated("use `sortWith` instead", "2.8.0") def sort(lt : (A,A) => Boolean): List[A] = { /** Merge two already-sorted lists */ def merge(l1: List[A], l2: List[A]): List[A] = { @@ -446,7 +446,7 @@ object List extends SeqFactory[List] { * or decreasing. * @return the sorted list of all integers in range [start;end). */ - @deprecated("use `iterate' instead", "2.8.0") + @deprecated("use `iterate` instead", "2.8.0") def range(start: Int, end: Int, step: Int => Int): List[Int] = { val up = step(start) > start val down = step(start) < start @@ -468,7 +468,7 @@ object List extends SeqFactory[List] { * @param elem the element composing the resulting list * @return a list composed of n elements all equal to elem */ - @deprecated("use `fill' instead", "2.8.0") + @deprecated("use `fill` instead", "2.8.0") def make[A](n: Int, elem: A): List[A] = { val b = new ListBuffer[A] var i = 0 @@ -484,7 +484,7 @@ object List extends SeqFactory[List] { * @param xss the list of lists that are to be concatenated * @return the concatenation of all the lists */ - @deprecated("use `xss.flatten' instead of `List.flatten(xss)'", "2.8.0") + @deprecated("use `xss.flatten` instead of `List.flatten(xss)`", "2.8.0") def flatten[A](xss: List[List[A]]): List[A] = { val b = new ListBuffer[A] for (xs <- xss) { @@ -502,7 +502,7 @@ object List extends SeqFactory[List] { * @param xs the list of pairs to unzip * @return a pair of lists. */ - @deprecated("use `xs.unzip' instead of `List.unzip(xs)'", "2.8.0") + @deprecated("use `xs.unzip` instead of `List.unzip(xs)`", "2.8.0") def unzip[A,B](xs: List[(A,B)]): (List[A], List[B]) = { val b1 = new ListBuffer[A] val b2 = new ListBuffer[B] @@ -520,7 +520,7 @@ object List extends SeqFactory[List] { * @param xs the iterable of pairs to unzip * @return a pair of lists. */ - @deprecated("use `xs.unzip' instead of `List.unzip(xs)'", "2.8.0") + @deprecated("use `xs.unzip` instead of `List.unzip(xs)`", "2.8.0") def unzip[A,B](xs: Iterable[(A,B)]): (List[A], List[B]) = xs.foldRight[(List[A], List[B])]((Nil, Nil)) { case ((x, y), (xs, ys)) => (x :: xs, y :: ys) @@ -530,7 +530,7 @@ object List extends SeqFactory[List] { * Returns the `Left` values in the given `Iterable` * of `Either`s. */ - @deprecated("use `xs collect { case Left(x: A) => x }' instead of `List.lefts(xs)'", "2.8.0") + @deprecated("use `xs collect { case Left(x: A) => x }` instead of `List.lefts(xs)`", "2.8.0") def lefts[A, B](es: Iterable[Either[A, B]]) = es.foldRight[List[A]](Nil)((e, as) => e match { case Left(a) => a :: as @@ -540,7 +540,7 @@ object List extends SeqFactory[List] { /** * Returns the `Right` values in the given`Iterable` of `Either`s. */ - @deprecated("use `xs collect { case Right(x: B) => x }' instead of `List.rights(xs)'", "2.8.0") + @deprecated("use `xs collect { case Right(x: B) => x }` instead of `List.rights(xs)`", "2.8.0") def rights[A, B](es: Iterable[Either[A, B]]) = es.foldRight[List[B]](Nil)((e, bs) => e match { case Left(_) => bs @@ -565,7 +565,7 @@ object List extends SeqFactory[List] { * @return a list that contains the elements returned by successive * calls to `it.next` */ - @deprecated("use `it.toList' instead of `List.toList(it)'", "2.8.0") + @deprecated("use `it.toList` instead of `List.toList(it)`", "2.8.0") def fromIterator[A](it: Iterator[A]): List[A] = it.toList /** Converts an array into a list. @@ -574,7 +574,7 @@ object List extends SeqFactory[List] { * @return a list that contains the same elements than `arr` * in the same order */ - @deprecated("use `array.toList' instead of `List.fromArray(array)'", "2.8.0") + @deprecated("use `array.toList` instead of `List.fromArray(array)`", "2.8.0") def fromArray[A](arr: Array[A]): List[A] = fromArray(arr, 0, arr.length) /** Converts a range of an array into a list. @@ -585,7 +585,7 @@ object List extends SeqFactory[List] { * @return a list that contains the same elements than `arr` * in the same order */ - @deprecated("use `array.view(start, end).toList' instead of `List.fromArray(array, start, end)'", "2.8.0") + @deprecated("use `array.view(start, end).toList` instead of `List.fromArray(array, start, end)`", "2.8.0") def fromArray[A](arr: Array[A], start: Int, len: Int): List[A] = { var res: List[A] = Nil var i = start + len @@ -603,7 +603,7 @@ object List extends SeqFactory[List] { * @param separator the separator character * @return the list of substrings */ - @deprecated("use `str.split(separator).toList' instead of `List.fromString(str, separator)'", "2.8.0") + @deprecated("use `str.split(separator).toList` instead of `List.fromString(str, separator)`", "2.8.0") def fromString(str: String, separator: Char): List[String] = { var words: List[String] = Nil var pos = str.length() @@ -621,7 +621,7 @@ object List extends SeqFactory[List] { * @param xs the list to convert. * @return the list in form of a string. */ - @deprecated("use `xs.mkString' instead of `List.toString(xs)'", "2.8.0") + @deprecated("use `xs.mkString` instead of `List.toString(xs)`", "2.8.0") def toString(xs: List[Char]): String = { val sb = new StringBuilder() var xc = xs @@ -635,7 +635,7 @@ object List extends SeqFactory[List] { /** Like xs map f, but returns `xs` unchanged if function * `f` maps all elements to themselves. */ - @deprecated("use `xs.mapConserve(f)' instead of `List.mapConserve(xs, f)'", "2.8.0") + @deprecated("use `xs.mapConserve(f)` instead of `List.mapConserve(xs, f)`", "2.8.0") def mapConserve[A <: AnyRef](xs: List[A])(f: A => A): List[A] = { def loop(ys: List[A]): List[A] = if (ys.isEmpty) xs @@ -669,7 +669,7 @@ object List extends SeqFactory[List] { * `[a0, ..., ak]`, `[b0, ..., bl]` and * `n = min(k,l)` */ - @deprecated("use `(xs, ys).zipped.map(f)' instead of `List.map2(xs, ys)(f)'", "2.8.0") + @deprecated("use `(xs, ys).zipped.map(f)` instead of `List.map2(xs, ys)(f)`", "2.8.0") def map2[A,B,C](xs: List[A], ys: List[B])(f: (A, B) => C): List[C] = { val b = new ListBuffer[C] var xc = xs @@ -693,7 +693,7 @@ object List extends SeqFactory[List] { * `[c<sub>0</sub>, ..., c<sub>m</sub>]` and * `n = min(k,l,m)` */ - @deprecated("use `(xs, ys, zs).zipped.map(f)' instead of `List.map3(xs, ys, zs)(f)'", "2.8.0") + @deprecated("use `(xs, ys, zs).zipped.map(f)` instead of `List.map3(xs, ys, zs)(f)`", "2.8.0") def map3[A,B,C,D](xs: List[A], ys: List[B], zs: List[C])(f: (A, B, C) => D): List[D] = { val b = new ListBuffer[D] var xc = xs @@ -718,7 +718,7 @@ object List extends SeqFactory[List] { * `[b<sub>0</sub>, ..., b<sub>l</sub>]` * and `n = min(k,l)` */ - @deprecated("use `(xs, ys).zipped.forall(f)' instead of `List.forall2(xs, ys)(f)'", "2.8.0") + @deprecated("use `(xs, ys).zipped.forall(f)` instead of `List.forall2(xs, ys)(f)`", "2.8.0") def forall2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = { var xc = xs var yc = ys @@ -740,7 +740,7 @@ object List extends SeqFactory[List] { * `[b<sub>0</sub>, ..., b<sub>l</sub>]` and * `n = min(k,l)` */ - @deprecated("use `(xs, ys).zipped.exists(f)' instead of `List.exists2(xs, ys)(f)'", "2.8.0") + @deprecated("use `(xs, ys).zipped.exists(f)` instead of `List.exists2(xs, ys)(f)`", "2.8.0") def exists2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = { var xc = xs var yc = ys @@ -758,7 +758,7 @@ object List extends SeqFactory[List] { * @param xss the list of lists * @return the transposed list of lists */ - @deprecated("use `xss.transpose' instead of `List.transpose(xss)'", "2.8.0") + @deprecated("use `xss.transpose` instead of `List.transpose(xss)`", "2.8.0") def transpose[A](xss: List[List[A]]): List[List[A]] = { val buf = new ListBuffer[List[A]] var yss = xss diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala index df1cfa80cd..ea16e04ebe 100644 --- a/src/library/scala/collection/immutable/Map.scala +++ b/src/library/scala/collection/immutable/Map.scala @@ -93,7 +93,7 @@ object Map extends ImmutableMapFactory[Map] { def - (key: Any): Map[Any, Nothing] = this } - @deprecated("use `Map.empty' instead", "2.8.0") + @deprecated("use `Map.empty` instead", "2.8.0") class EmptyMap[A,B] extends Map[A,B] with Serializable { override def size: Int = 0 def get(key: A): Option[B] = None diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala index 7551238f55..377412261c 100644 --- a/src/library/scala/collection/immutable/PagedSeq.scala +++ b/src/library/scala/collection/immutable/PagedSeq.scala @@ -59,8 +59,8 @@ object PagedSeq { fromStrings(source.iterator) /** Constructs a character sequence from a line iterator - * Lines do not contain trailing `\n' characters; The method inserts - * a line separator `\n' between any two lines in the sequence. + * Lines do not contain trailing `\n` characters; The method inserts + * a line separator `\n` between any two lines in the sequence. */ def fromLines(source: Iterator[String]): PagedSeq[Char] = { var isFirst = true @@ -73,8 +73,8 @@ object PagedSeq { } /** Constructs a character sequence from a line iterable - * Lines do not contain trailing `\n' characters; The method inserts - * a line separator `\n' between any two lines in the sequence. + * Lines do not contain trailing `\n` characters; The method inserts + * a line separator `\n` between any two lines in the sequence. */ def fromLines(source: Iterable[String]): PagedSeq[Char] = fromLines(source.iterator) @@ -104,7 +104,7 @@ object PagedSeq { import PagedSeq._ /** An implementation of lazily computed sequences, where elements are stored - * in ``pages'', i.e. arrays of fixed size. + * in "pages", i.e. arrays of fixed size. * * @tparam T the type of the elements contained in this paged sequence, with a `ClassManifest` context bound. * @@ -156,14 +156,14 @@ extends scala.collection.IndexedSeq[T] (latest.end min end) - start } - /** The character at position `index'. + /** The character at position `index`. */ def apply(index: Int) = if (isDefinedAt(index)) page(index + start)(index + start) else throw new IndexOutOfBoundsException(index.toString) - /** Is character sequence defined at `index'? - * Unlike `length' this operation does not force reading + /** Is character sequence defined at `index`? + * Unlike `length` this operation does not force reading * a lazy sequence to the end. */ override def isDefinedAt(index: Int) = @@ -171,8 +171,8 @@ extends scala.collection.IndexedSeq[T] val p = page(index + start); index + start < p.end } - /** the subsequence from index `start' up to and excluding - * the minimum of index `end' and the length of the current sequence. + /** the subsequence from index `start` up to and excluding + * the minimum of index `end` and the length of the current sequence. */ override def slice(_start: Int, _end: Int): PagedSeq[T] = { page(start) @@ -183,7 +183,7 @@ extends scala.collection.IndexedSeq[T] new PagedSeq(more, f, s, e) } - /** the subsequence from index `start' up to the + /** the subsequence from index `start` up to the * length of the current sequence. */ def slice(start: Int): PagedSeq[T] = slice(start, UndeterminedEnd) @@ -212,7 +212,7 @@ private class Page[T: ClassManifest](val num: Int) { /** The number of characters read into this page */ var filled: Int = 0 - /** Is this page the permamnently last one in the sequence? Only true once `more' + /** Is this page the permamnently last one in the sequence? Only true once `more` * method has returned -1 to signal end of input. */ var isLast: Boolean = false @@ -239,7 +239,7 @@ private class Page[T: ClassManifest](val num: Int) { data(index - start) } - /** produces more characters by calling `more' and appends them on the current page, + /** produces more characters by calling `more` and appends them on the current page, * or fills a subsequent page if current page is full * pre: if current page is full, it is the last one in the sequence. */ diff --git a/src/library/scala/collection/immutable/RedBlack.scala b/src/library/scala/collection/immutable/RedBlack.scala index 4bea8fbaf1..bac60ac4f9 100644 --- a/src/library/scala/collection/immutable/RedBlack.scala +++ b/src/library/scala/collection/immutable/RedBlack.scala @@ -35,11 +35,11 @@ abstract class RedBlack[A] extends Serializable { def delete(k: A): Tree[B] = blacken(del(k)) def range(from: Option[A], until: Option[A]): Tree[B] = blacken(rng(from, until)) def foreach[U](f: (A, B) => U) - @deprecated("use `foreach' instead", "2.8.0") + @deprecated("use `foreach` instead", "2.8.0") def visit[T](input: T)(f: (T, A, B) => (Boolean, T)): (Boolean, T) def toStream: Stream[(A,B)] def iterator: Iterator[(A, B)] - @deprecated("use `iterator' instead", "2.8.0") + @deprecated("use `iterator` instead", "2.8.0") def elements = iterator def upd[B1 >: B](k: A, v: B1): Tree[B1] def del(k: A): Tree[B] @@ -165,7 +165,7 @@ abstract class RedBlack[A] extends Serializable { right foreach f } - @deprecated("use `foreach' instead", "2.8.0") + @deprecated("use `foreach` instead", "2.8.0") def visit[T](input: T)(f: (T,A,B) => (Boolean, T)): (Boolean, T) = { val left = this.left.visit(input)(f) if (!left._1) return left @@ -281,7 +281,7 @@ abstract class RedBlack[A] extends Serializable { def foreach[U](f: (A, Nothing) => U) {} - @deprecated("use `foreach' instead", "2.8.0") + @deprecated("use `foreach` instead", "2.8.0") def visit[T](input: T)(f: (T, A, Nothing) => (Boolean, T)) = (true, input) def rng(from: Option[A], until: Option[A]) = this diff --git a/src/library/scala/collection/immutable/Set.scala b/src/library/scala/collection/immutable/Set.scala index ce2b3b1885..cb2823aeda 100644 --- a/src/library/scala/collection/immutable/Set.scala +++ b/src/library/scala/collection/immutable/Set.scala @@ -58,7 +58,7 @@ object Set extends ImmutableSetFactory[Set] { override def foreach[U](f: Any => U): Unit = {} } - @deprecated("use `Set.empty' instead", "2.8.0") + @deprecated("use `Set.empty` instead", "2.8.0") class EmptySet[A] extends Set[A] with Serializable { override def size: Int = 0 def contains(elem: A): Boolean = false diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala index b6145ecaf0..95ffaf5a3e 100644 --- a/src/library/scala/collection/immutable/Stream.scala +++ b/src/library/scala/collection/immutable/Stream.scala @@ -498,7 +498,7 @@ self => override def apply(idx: Int) = self.apply(idx) } - /** Defines the prefix of this object's <code>toString</code> representation as ``Stream''. + /** Defines the prefix of this object's `toString` representation as `Stream`. */ override def stringPrefix = "Stream" @@ -726,7 +726,7 @@ object Stream extends SeqFactory[Stream] { * @param step the increment function of the stream, must be monotonically increasing or decreasing * @return the stream starting at value <code>start</code>. */ - @deprecated("use `iterate' instead.", "2.8.0") + @deprecated("use `iterate` instead.", "2.8.0") def range(start: Int, end: Int, step: Int => Int): Stream[Int] = iterate(start, end - start)(step) @@ -736,7 +736,7 @@ object Stream extends SeqFactory[Stream] { * @param elem the element composing the resulting stream * @return the stream containing an infinite number of elem */ - @deprecated("use `continually' instead", "2.8.0") + @deprecated("use `continually` instead", "2.8.0") def const[A](elem: A): Stream[A] = cons(elem, const(elem)) /** Create a stream containing several copies of an element. diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala index 5a3a369286..02e74a3a64 100644 --- a/src/library/scala/collection/immutable/StringLike.scala +++ b/src/library/scala/collection/immutable/StringLike.scala @@ -218,10 +218,10 @@ self => toString.split(re) } - /** You can follow a string with `.r', turning + /** You can follow a string with `.r`, turning * it into a Regex. E.g. * - * """A\w*""".r is the regular expression for identifiers starting with `A'. + * """A\w*""".r is the regular expression for identifiers starting with `A`. */ def r: Regex = new Regex(toString) diff --git a/src/library/scala/collection/mutable/BufferLike.scala b/src/library/scala/collection/mutable/BufferLike.scala index 0445adaa23..067911f75e 100644 --- a/src/library/scala/collection/mutable/BufferLike.scala +++ b/src/library/scala/collection/mutable/BufferLike.scala @@ -234,26 +234,26 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] * the collection itself. * * $compatMutate - * You are strongly recommended to use '+=' instead. + * You are strongly recommended to use `+=` instead. * * @param elem the element to add. */ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+ - "Use `clone() +=' if you intend to create a new collection.", "2.8.0") + "Use `clone() +=` if you intend to create a new collection.", "2.8.0") def + (elem: A): This = { +=(elem); repr } /** Adds two or more elements to this collection and returns * the collection itself. * * $compatMutate - * You are strongly recommended to use '++=' instead. + * You are strongly recommended to use `++=` instead. * * @param elem1 the first element to add. * @param elem2 the second element to add. * @param elems the remaining elements to add. */ @deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\n"+ - "Use `clone() ++=' if you intend to create a new collection.", "2.8.0") + "Use `clone() ++=` if you intend to create a new collection.", "2.8.0") def + (elem1: A, elem2: A, elems: A*): This = { this += elem1 += elem2 ++= elems repr diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala index 03102f73d2..a06b930033 100644 --- a/src/library/scala/collection/mutable/BufferProxy.scala +++ b/src/library/scala/collection/mutable/BufferProxy.scala @@ -45,7 +45,7 @@ trait BufferProxy[A] extends Buffer[A] with Proxy { * @return the updated buffer. */ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+ - "Use `clone() ++=' if you intend to create a new collection.", "2.8.0") + "Use `clone() ++=` if you intend to create a new collection.", "2.8.0") override def +(elem: A): Buffer[A] = self.+(elem) /** Append a single element to this buffer. diff --git a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala index d541ad8f52..8e01908a97 100644 --- a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala +++ b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala @@ -54,7 +54,7 @@ extends Map[A, B] with Serializable def iterator: Iterator[(A, B)] = imap.iterator - @deprecated("use `iterator' instead", "2.8.0") + @deprecated("use `iterator` instead", "2.8.0") override def elements = iterator override def toList: List[(A, B)] = imap.toList diff --git a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala index 0975b33dd0..2c1da15153 100644 --- a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala +++ b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala @@ -40,7 +40,7 @@ class ImmutableSetAdaptor[A](protected var set: immutable.Set[A]) extends Set[A] def iterator: Iterator[A] = set.iterator - @deprecated("use `iterator' instead", "2.8.0") + @deprecated("use `iterator` instead", "2.8.0") override def elements: Iterator[A] = iterator def +=(elem: A): this.type = { set = set + elem; this } diff --git a/src/library/scala/collection/mutable/IndexedSeqView.scala b/src/library/scala/collection/mutable/IndexedSeqView.scala index 6af00d03b1..f13a6bb70a 100644 --- a/src/library/scala/collection/mutable/IndexedSeqView.scala +++ b/src/library/scala/collection/mutable/IndexedSeqView.scala @@ -19,7 +19,7 @@ import TraversableView.NoBuilder * $viewInfo * Some of the operations of this class will yield again a mutable indexed sequence, * others will just yield a plain indexed sequence of type `collection.IndexedSeq`. - * Because this is a leaf class there is no associated `Like' class. + * Because this is a leaf class there is no associated `Like` class. * @author Martin Odersky * @version 2.8 * @since 2.8 diff --git a/src/library/scala/collection/mutable/MapLike.scala b/src/library/scala/collection/mutable/MapLike.scala index 92c6e8c162..38de28f084 100644 --- a/src/library/scala/collection/mutable/MapLike.scala +++ b/src/library/scala/collection/mutable/MapLike.scala @@ -164,7 +164,7 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] * If key is not present return None. * @param key the key to be removed */ - @deprecated("Use `remove' instead", "2.8.0") + @deprecated("Use `remove` instead", "2.8.0") def removeKey(key: A): Option[B] = remove(key) /** Removes all bindings from the map. After this operation has completed, diff --git a/src/library/scala/collection/mutable/MutableList.scala b/src/library/scala/collection/mutable/MutableList.scala index 3a0d9e0996..c931513da9 100644 --- a/src/library/scala/collection/mutable/MutableList.scala +++ b/src/library/scala/collection/mutable/MutableList.scala @@ -100,7 +100,7 @@ extends LinearSeq[A] last0.next = new LinkedList[A] last0 = last0.next last0.elem = elem - last0.next = new LinkedList[A] // for performance, use sentinel `object' instead? + last0.next = new LinkedList[A] // for performance, use sentinel `object` instead? len = len + 1 } diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala index 31113797dd..f67aabc62d 100644 --- a/src/library/scala/collection/mutable/PriorityQueue.scala +++ b/src/library/scala/collection/mutable/PriorityQueue.scala @@ -92,8 +92,8 @@ class PriorityQueue[A](implicit val ord: Ordering[A]) } @deprecated( - "Use += instead if you intend to add by side effect to an existing collection.\n"+ - "Use `clone() +=' if you intend to create a new collection.", "2.8.0" + "Use `+=` instead if you intend to add by side effect to an existing collection.\n"+ + "Use `clone() +=` if you intend to create a new collection.", "2.8.0" ) def +(elem: A): PriorityQueue[A] = { this.clone() += elem } @@ -103,8 +103,8 @@ class PriorityQueue[A](implicit val ord: Ordering[A]) * @param kvs the remaining elements. */ @deprecated( - "Use ++= instead if you intend to add by side effect to an existing collection.\n"+ - "Use `clone() ++=' if you intend to create a new collection.", "2.8.0" + "Use `++=` instead if you intend to add by side effect to an existing collection.\n"+ + "Use `clone() ++=` if you intend to create a new collection.", "2.8.0" ) def +(elem1: A, elem2: A, elems: A*) = { this.clone().+=(elem1, elem2, elems : _*) } diff --git a/src/library/scala/collection/mutable/Publisher.scala b/src/library/scala/collection/mutable/Publisher.scala index 7e06199515..d306fb702d 100644 --- a/src/library/scala/collection/mutable/Publisher.scala +++ b/src/library/scala/collection/mutable/Publisher.scala @@ -32,8 +32,8 @@ trait Publisher[Evt] { type Sub = Subscriber[Evt, Pub] type Filter = Evt => Boolean - /** The publisher itself of type `Pub'. Implemented by a cast from `this' here. - * Needs to be overridden if the actual publisher is different from `this'. + /** The publisher itself of type `Pub`. Implemented by a cast from `this` here. + * Needs to be overridden if the actual publisher is different from `this`. */ protected val self: Pub = this.asInstanceOf[Pub] diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala index 8d7ed8bcd2..d6d0951594 100644 --- a/src/library/scala/collection/mutable/StringBuilder.scala +++ b/src/library/scala/collection/mutable/StringBuilder.scala @@ -89,7 +89,7 @@ final class StringBuilder(private val underlying: JavaStringBuilder) */ def capacity: Int = underlying.capacity() - @deprecated("Use `ensureCapacity' instead. An assignment is misleading because\n"+ + @deprecated("Use `ensureCapacity` instead. An assignment is misleading because\n"+ "it can never decrease the capacity.", "2.8.0") def capacity_=(n: Int) { ensureCapacity(n) } @@ -367,11 +367,11 @@ final class StringBuilder(private val underlying: JavaStringBuilder) def insert(index: Int, x: Char): StringBuilder = insert(index, String.valueOf(x)) @deprecated("Use appendAll instead. This method is deprecated because of the\n"+ - "possible confusion with `append(Any)'.", "2.8.0") + "possible confusion with `append(Any)`.", "2.8.0") def append(x: Seq[Char]): StringBuilder = appendAll(x) @deprecated("use appendAll instead. This method is deprecated because\n"+ - "of the possible confusion with `append(Any)'.", "2.8.0") + "of the possible confusion with `append(Any)`.", "2.8.0") def append(x: Array[Char]): StringBuilder = appendAll(x) @deprecated("use appendAll instead. This method is deprecated because\n"+ diff --git a/src/library/scala/concurrent/ops.scala b/src/library/scala/concurrent/ops.scala index 9498a62f32..db6e81cc26 100644 --- a/src/library/scala/concurrent/ops.scala +++ b/src/library/scala/concurrent/ops.scala @@ -49,7 +49,7 @@ object ops runner.futureAsFunction(runner submit runner.functionAsTask(() => p)) } - /** Evaluates two expressions in parallel. Invoking `par' blocks the current + /** Evaluates two expressions in parallel. Invoking `par` blocks the current * thread until both expressions have been evaluated. * * @param xp the first expression to evaluate @@ -68,7 +68,7 @@ object ops * @param end ... * @param p ... */ - @deprecated("use `collection.parallel.ParIterable.foreach' instead", "2.9.0") + @deprecated("use `collection.parallel.ParIterable.foreach` instead", "2.9.0") def replicate(start: Int, end: Int)(p: Int => Unit)(implicit runner: TaskRunner = defaultRunner) { if (start == end) () diff --git a/src/library/scala/math/BigInt.scala b/src/library/scala/math/BigInt.scala index 5b6fc6ffd5..b8ddd54233 100644 --- a/src/library/scala/math/BigInt.scala +++ b/src/library/scala/math/BigInt.scala @@ -215,7 +215,7 @@ class BigInt(val bigInteger: BigInteger) extends ScalaNumber with ScalaNumericCo def gcd (that: BigInt): BigInt = new BigInt(this.bigInteger.gcd(that.bigInteger)) /** Returns a BigInt whose value is (this mod m). - * This method differs from `%' in that it always returns a non-negative BigInt. + * This method differs from `%` in that it always returns a non-negative BigInt. */ def mod (that: BigInt): BigInt = new BigInt(this.bigInteger.mod(that.bigInteger)) diff --git a/src/library/scala/reflect/ClassManifest.scala b/src/library/scala/reflect/ClassManifest.scala index 3f3892e802..2189f6df82 100644 --- a/src/library/scala/reflect/ClassManifest.scala +++ b/src/library/scala/reflect/ClassManifest.scala @@ -49,7 +49,7 @@ trait ClassManifest[T] extends OptManifest[T] with Equals with Serializable { } /** Tests whether the type represented by this manifest is a subtype - * of the type represented by `that' manifest, subject to the limitations + * of the type represented by `that` manifest, subject to the limitations * described in the header. */ def <:<(that: ClassManifest[_]): Boolean = { @@ -82,7 +82,7 @@ trait ClassManifest[T] extends OptManifest[T] with Equals with Serializable { } /** Tests whether the type represented by this manifest is a supertype - * of the type represented by `that' manifest, subject to the limitations + * of the type represented by `that` manifest, subject to the limitations * described in the header. */ def >:>(that: ClassManifest[_]): Boolean = @@ -94,7 +94,7 @@ trait ClassManifest[T] extends OptManifest[T] with Equals with Serializable { } /** Tests whether the type represented by this manifest is equal to - * the type represented by `that' manifest, subject to the limitations + * the type represented by `that` manifest, subject to the limitations * described in the header. */ override def equals(that: Any): Boolean = that match { @@ -179,7 +179,7 @@ object ClassManifest { def singleType[T <: AnyRef](value: AnyRef): Manifest[T] = Manifest.singleType(value) - /** ClassManifest for the class type `clazz', where `clazz' is + /** ClassManifest for the class type `clazz`, where `clazz` is * a top-level or static class. * @note This no-prefix, no-arguments case is separate because we * it's called from ScalaRunTime.boxArray itself. If we @@ -189,12 +189,12 @@ object ClassManifest { def classType[T <: AnyRef](clazz: JClass[_]): ClassManifest[T] = new ClassTypeManifest[T](None, clazz, Nil) - /** ClassManifest for the class type `clazz[args]', where `clazz' is + /** ClassManifest for the class type `clazz[args]`, where `clazz` is * a top-level or static class and `args` are its type arguments */ def classType[T <: AnyRef](clazz: JClass[_], arg1: OptManifest[_], args: OptManifest[_]*): ClassManifest[T] = new ClassTypeManifest[T](None, clazz, arg1 :: args.toList) - /** ClassManifest for the class type `clazz[args]', where `clazz' is + /** ClassManifest for the class type `clazz[args]`, where `clazz` is * a class with non-package prefix type `prefix` and type arguments `args`. */ def classType[T <: AnyRef](prefix: OptManifest[_], clazz: JClass[_], args: OptManifest[_]*): ClassManifest[T] = @@ -205,7 +205,7 @@ object ClassManifest { case m: ClassManifest[_] => m.asInstanceOf[ClassManifest[T]].arrayManifest } - /** ClassManifest for the abstract type `prefix # name'. `upperBound' is not + /** ClassManifest for the abstract type `prefix # name`. `upperBound` is not * strictly necessary as it could be obtained by reflection. It was * added so that erasure can be calculated without reflection. */ def abstractType[T](prefix: OptManifest[_], name: String, clazz: JClass[_], args: OptManifest[_]*): ClassManifest[T] = @@ -215,7 +215,7 @@ object ClassManifest { override def toString = prefix.toString+"#"+name+argString } - /** ClassManifest for the abstract type `prefix # name'. `upperBound' is not + /** ClassManifest for the abstract type `prefix # name`. `upperBound` is not * strictly necessary as it could be obtained by reflection. It was * added so that erasure can be calculated without reflection. * todo: remove after next boostrap @@ -228,7 +228,7 @@ object ClassManifest { } } -/** Manifest for the class type `clazz[args]', where `clazz' is +/** Manifest for the class type `clazz[args]`, where `clazz` is * a top-level or static class. */ private class ClassTypeManifest[T <: AnyRef]( prefix: Option[OptManifest[_]], diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala index 229fa728a8..a75f90ebf0 100644 --- a/src/library/scala/reflect/Manifest.scala +++ b/src/library/scala/reflect/Manifest.scala @@ -204,11 +204,11 @@ object Manifest { override lazy val toString = value.toString + ".type" } - /** Manifest for the singleton type `value.type'. */ + /** Manifest for the singleton type `value.type`. */ def singleType[T <: AnyRef](value: AnyRef): Manifest[T] = new SingletonTypeManifest[T](value) - /** Manifest for the class type `clazz[args]', where `clazz' is + /** Manifest for the class type `clazz[args]`, where `clazz` is * a top-level or static class. * @note This no-prefix, no-arguments case is separate because we * it's called from ScalaRunTime.boxArray itself. If we @@ -218,18 +218,18 @@ object Manifest { def classType[T](clazz: Predef.Class[_]): Manifest[T] = new ClassTypeManifest[T](None, clazz, Nil) - /** Manifest for the class type `clazz', where `clazz' is + /** Manifest for the class type `clazz`, where `clazz` is * a top-level or static class and args are its type arguments. */ def classType[T](clazz: Predef.Class[T], arg1: Manifest[_], args: Manifest[_]*): Manifest[T] = new ClassTypeManifest[T](None, clazz, arg1 :: args.toList) - /** Manifest for the class type `clazz[args]', where `clazz' is + /** Manifest for the class type `clazz[args]`, where `clazz` is * a class with non-package prefix type `prefix` and type arguments `args`. */ def classType[T](prefix: Manifest[_], clazz: Predef.Class[_], args: Manifest[_]*): Manifest[T] = new ClassTypeManifest[T](Some(prefix), clazz, args.toList) - /** Manifest for the class type `clazz[args]', where `clazz' is + /** Manifest for the class type `clazz[args]`, where `clazz` is * a top-level or static class. */ private class ClassTypeManifest[T](prefix: Option[Manifest[_]], val erasure: Predef.Class[_], @@ -243,7 +243,7 @@ object Manifest { def arrayType[T](arg: Manifest[_]): Manifest[Array[T]] = arg.asInstanceOf[Manifest[T]].arrayManifest - /** Manifest for the abstract type `prefix # name'. `upperBound' is not + /** Manifest for the abstract type `prefix # name'. `upperBound` is not * strictly necessary as it could be obtained by reflection. It was * added so that erasure can be calculated without reflection. */ def abstractType[T](prefix: Manifest[_], name: String, clazz: Predef.Class[_], args: Manifest[_]*): Manifest[T] = @@ -253,7 +253,7 @@ object Manifest { override def toString = prefix.toString+"#"+name+argString } - /** Manifest for the unknown type `_ >: L <: U' in an existential. + /** Manifest for the unknown type `_ >: L <: U` in an existential. */ def wildcardType[T](lowerBound: Manifest[_], upperBound: Manifest[_]): Manifest[T] = new Manifest[T] { diff --git a/src/library/scala/reflect/generic/Flags.scala b/src/library/scala/reflect/generic/Flags.scala index b56faf8934..61dd93928c 100755 --- a/src/library/scala/reflect/generic/Flags.scala +++ b/src/library/scala/reflect/generic/Flags.scala @@ -14,7 +14,7 @@ package generic final val CASE = 0x00000800 final val ABSTRACT = 0x00000008 // abstract class, or used in conjunction with abstract override. // Note difference to DEFERRED! - final val DEFERRED = 0x00000010 // was `abstract' for members | trait is virtual + final val DEFERRED = 0x00000010 // was `abstract` for members | trait is virtual final val INTERFACE = 0x00000080 // symbol is an interface (i.e. a trait which defines only abstract methods) final val MUTABLE = 0x00001000 // symbol is a mutable variable. final val PARAM = 0x00002000 // symbol is a (value or type) parameter to a method @@ -77,8 +77,8 @@ object ModifierFlags extends ModifierFlags final val VBRIDGE = 0x40000000000L// symbol is a varargs bridge final val VARARGS = 0x80000000000L// symbol is a Java-style varargs method - final val TRIEDCOOKING = 0x100000000000L // ``Cooking'' has been tried on this symbol - // A Java method's type is ``cooked'' by transforming raw types to existentials + final val TRIEDCOOKING = 0x100000000000L // "Cooking" has been tried on this symbol + // A Java method's type is "cooked" by transforming raw types to existentials // pickling and unpickling of flags diff --git a/src/library/scala/reflect/generic/PickleFormat.scala b/src/library/scala/reflect/generic/PickleFormat.scala index c6308e7db8..9c7dc72d69 100755 --- a/src/library/scala/reflect/generic/PickleFormat.scala +++ b/src/library/scala/reflect/generic/PickleFormat.scala @@ -110,7 +110,7 @@ package generic * AnnotArg = Tree | Constant * ConstAnnotArg = Constant | AnnotInfo | AnnotArgArray * - * len is remaining length after `len'. + * len is remaining length after `len`. */ val MajorVersion = 5 val MinorVersion = 0 diff --git a/src/library/scala/reflect/generic/StdNames.scala b/src/library/scala/reflect/generic/StdNames.scala index 8f8d695016..de5c98886b 100755 --- a/src/library/scala/reflect/generic/StdNames.scala +++ b/src/library/scala/reflect/generic/StdNames.scala @@ -30,7 +30,7 @@ import scala.reflect.NameTransformer val LOCAL_SUFFIX_STRING = " " val ROOTPKG: NameType = "_root_" - /** The expanded name of `name' relative to this class `base` with given `separator` + /** The expanded name of `name` relative to this class `base` with given `separator` */ def expandedName(name: TermName, base: Symbol, separator: String = EXPAND_SEPARATOR_STRING): TermName = newTermName(base.fullName('$') + separator + name) diff --git a/src/library/scala/reflect/generic/Symbols.scala b/src/library/scala/reflect/generic/Symbols.scala index a58711663e..7efb87676f 100755 --- a/src/library/scala/reflect/generic/Symbols.scala +++ b/src/library/scala/reflect/generic/Symbols.scala @@ -99,7 +99,7 @@ import Flags._ * object Foo * class Foo * - * Then object Foo has a `moduleClass' (invisible to the user, the backend calls it Foo$ + * Then object Foo has a `moduleClass` (invisible to the user, the backend calls it Foo$ * linkedClassOfClass goes from class Foo$ to class Foo, and back. */ def linkedClassOfClass: Symbol diff --git a/src/library/scala/reflect/generic/Trees.scala b/src/library/scala/reflect/generic/Trees.scala index d44f6b5b8f..dace1628da 100755 --- a/src/library/scala/reflect/generic/Trees.scala +++ b/src/library/scala/reflect/generic/Trees.scala @@ -407,7 +407,7 @@ import Flags._ */ case class ApplyDynamic(qual: Tree, args: List[Tree]) extends TermTree with SymTree - // The symbol of an ApplyDynamic is the function symbol of `qual', or NoSymbol, if there is none. + // The symbol of an ApplyDynamic is the function symbol of `qual`, or NoSymbol, if there is none. /** Super reference, qual = corresponding this reference */ case class Super(qual: Tree, mix: TypeName) extends TermTree { diff --git a/src/library/scala/reflect/generic/Types.scala b/src/library/scala/reflect/generic/Types.scala index 837f5484db..b3601cf364 100755 --- a/src/library/scala/reflect/generic/Types.scala +++ b/src/library/scala/reflect/generic/Types.scala @@ -11,7 +11,7 @@ package generic */ def isComplete: Boolean = true - /** If this is a lazy type, assign a new type to `sym'. */ + /** If this is a lazy type, assign a new type to `sym`. */ def complete(sym: Symbol) {} /** Convert toString avoiding infinite recursions by cutting off diff --git a/src/library/scala/reflect/generic/UnPickler.scala b/src/library/scala/reflect/generic/UnPickler.scala index 3bae268295..5d47195f54 100755 --- a/src/library/scala/reflect/generic/UnPickler.scala +++ b/src/library/scala/reflect/generic/UnPickler.scala @@ -61,7 +61,7 @@ abstract class UnPickler { /** A map from entry numbers to symbols, types, or annotations */ private val entries = new Array[AnyRef](index.length) - /** A map from symbols to their associated `decls' scopes */ + /** A map from symbols to their associated `decls` scopes */ private val symScopes = new HashMap[Symbol, Scope] //println("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug @@ -97,7 +97,7 @@ abstract class UnPickler { " in "+filename) } - /** The `decls' scope associated with given symbol */ + /** The `decls` scope associated with given symbol */ protected def symScope(sym: Symbol) = symScopes.getOrElseUpdate(sym, newScope) /** Does entry represent an (internal) symbol */ diff --git a/src/library/scala/util/control/Breaks.scala b/src/library/scala/util/control/Breaks.scala index c436df9f8f..331d30e0bb 100644 --- a/src/library/scala/util/control/Breaks.scala +++ b/src/library/scala/util/control/Breaks.scala @@ -29,7 +29,7 @@ class Breaks { private val breakException = new BreakControl - /** A block from which one can exit with a `break''. */ + /** A block from which one can exit with a `break`'. */ def breakable(op: => Unit) { try { op diff --git a/src/library/scala/util/matching/Regex.scala b/src/library/scala/util/matching/Regex.scala index 6a783e4594..663900dd0a 100644 --- a/src/library/scala/util/matching/Regex.scala +++ b/src/library/scala/util/matching/Regex.scala @@ -300,7 +300,7 @@ object Regex { nextSeen } - /** The next matched substring of `source' */ + /** The next matched substring of `source` */ def next: String = { if (!hasNext) throw new NoSuchElementException nextSeen = false diff --git a/src/library/scala/util/parsing/ast/Binders.scala b/src/library/scala/util/parsing/ast/Binders.scala index a4f457e1bf..2ecb702446 100644 --- a/src/library/scala/util/parsing/ast/Binders.scala +++ b/src/library/scala/util/parsing/ast/Binders.scala @@ -27,8 +27,8 @@ import scala.collection.mutable.Map * @author Adriaan Moors */ trait Mappable { - trait Mapper { def apply[T <% Mappable[T]](x: T): T } /* TODO: having type `Forall T. T => T' is too strict: - sometimes we want to allow `Forall T >: precision. T => T' for some type `precision', so that, + trait Mapper { def apply[T <% Mappable[T]](x: T): T } /* TODO: having type `Forall T. T => T` is too strict: + sometimes we want to allow `Forall T >: precision. T => T` for some type `precision`, so that, beneath a certain threshold, we have some leeway. concretely: to use gmap for substitution, we simply require that ast nodes are mapped to ast nodes, we can't require that the type is preserved precisely: a Name may map to e.g., a MethodCall @@ -68,27 +68,27 @@ trait Mappable { * allowed to be left unqualified, these mechanisms would have to be * complemented by an extra phase that resolves names that couldn't be * resolved using the naive binding rules. (Maybe some machinery to - * model `implicit' binders (e.g., `this' and imported qualifiers) + * model `implicit` binders (e.g., `this` and imported qualifiers) * and selection on a binder will suffice?) * </p> * * @author Adriaan Moors */ trait Binders extends AbstractSyntax with Mappable { - /** A `Scope' keeps track of one or more syntactic elements that represent bound names. - * The elements it contains share the same scope and must all be distinct (wrt. ==) + /** A `Scope` keeps track of one or more syntactic elements that represent bound names. + * The elements it contains share the same scope and must all be distinct, as determined by `==`. * - * A `NameElement' `n' in the AST that is conceptually bound by a `Scope' `s', is replaced by a - * `BoundElement(n, s)'. (For example, in `val x:Int=x+1', the first `x' is modelled by a - * Scope `s' that contains `x' and the second `x' is represented by a `BoundElement(`x', s)') - * The term (`x+1') in scope of the Scope becomes an `UnderBinder(s, `x+1'). + * A `NameElement` `n` in the AST that is conceptually bound by a `Scope` `s`, is replaced by a + * `BoundElement(n, s)'. (For example, in `val x:Int=x+1', the first `x` is modelled by a + * Scope `s` that contains `x` and the second `x` is represented by a `BoundElement(`x`, s)') + * The term (`x+1`) in scope of the Scope becomes an `UnderBinder(s, `x+1`). * - * A `NameElement' `n' is bound by a `Scope' `s' if it is wrapped as a `BoundElement(`n', s)', and - * `s' has a binder element that is semantically equal (`equals' or `==') to `n'. + * A `NameElement` `n` is bound by a `Scope` `s` if it is wrapped as a `BoundElement(`n`, s)', and + * `s` has a binder element that is semantically equal (`equals` or `==`) to `n`. * - * A `Scope' is represented textually by its list of binder elements, followed by the scope's `id'. - * For example: `[x, y]!1' represents the scope with `id' `1' and binder elements `x' and `y'. - * (`id' is solely used for this textual representation.) + * A `Scope` is represented textually by its list of binder elements, followed by the scope's `id`. + * For example: `[x, y]!1` represents the scope with `id` `1` and binder elements `x` and `y`. + * (`id` is solely used for this textual representation.) */ class Scope[binderType <: NameElement] extends Iterable[binderType]{ private val substitution: Map[binderType, Element] = @@ -104,10 +104,10 @@ trait Binders extends AbstractSyntax with Mappable { */ def iterator = substitution.keysIterator - /** Return the `i'th binder in this scope.*/ + /** Return the `i`th binder in this scope.*/ def apply(i: Int): binderType = this.iterator.toList(i) - /** Returns true if this container has a binder equal (==) to `b' + /** Returns true if this container has a binder equal (==) to `b` */ def binds(b: binderType): Boolean = substitution.contains(b) @@ -132,29 +132,29 @@ trait Binders extends AbstractSyntax with Mappable { */ def addBinder(b: binderType) { substitution += Pair(b, b) } - /** `canAddElement' indicates whether `b' may be added to this scope. + /** `canAddElement` indicates whether `b` may be added to this scope. * * TODO: strengthen this condition so that no binders may be added after this scope has been - * linked to its `UnderBinder' (i.e., while parsing, BoundElements may be added to the Scope + * linked to its `UnderBinder` (i.e., while parsing, BoundElements may be added to the Scope * associated to the UnderBinder, but after that, no changes are allowed, except for substitution)? * - * @return true if `b' had not been added yet + * @return true if `b` had not been added yet */ def canAddBinder(b: binderType): Boolean = !binds(b) /** ``Replaces'' the bound occurrences of a contained binder by their new value. - * The bound occurrences of `b' are not actually replaced; the scope keeps track - * of a substitution that maps every binder to its current value. Since a `BoundElement' is - * a proxy for the element it is bound to by its binder, `substitute' may thus be thought of - * as replacing all the bound occurrences of the given binder `b' by their new value `value'. + * The bound occurrences of `b` are not actually replaced; the scope keeps track + * of a substitution that maps every binder to its current value. Since a `BoundElement` is + * a proxy for the element it is bound to by its binder, `substitute` may thus be thought of + * as replacing all the bound occurrences of the given binder `b` by their new value `value`. * * @param b the binder whose bound occurrences should be given a new value. `binds(b)` must hold. - * @param value the new value for the bound occurrences of `b' + * @param value the new value for the bound occurrences of `b` * @return `getElementFor(b) eq value` will hold. */ def substitute(b: binderType, value: Element): Unit = substitution(b) = value - /** Returns the current value for the bound occurrences of `b'. + /** Returns the current value for the bound occurrences of `b`. * * @param b the contained binder whose current value should be returned `binds(b)` must hold. */ @@ -183,17 +183,17 @@ trait Binders extends AbstractSyntax with Mappable { // def alpha_==[bt <: binderType, st <: elementT](other: UnderBinder[bt, st]): Boolean } - /** A `BoundElement' is bound in a certain scope `scope', which keeps track of the actual element that - * `el' stands for. + /** A `BoundElement` is bound in a certain scope `scope`, which keeps track of the actual element that + * `el` stands for. * - * A `BoundElement' is represented textually by its bound element, followed by its scope's `id'. - * For example: `x@1' represents the variable `x' that is bound in the scope with `id' `1'. + * A `BoundElement` is represented textually by its bound element, followed by its scope's `id`. + * For example: `x@1` represents the variable `x` that is bound in the scope with `id` `1`. * * @note `scope.binds(el)` holds before and after. */ case class BoundElement[boundElement <: NameElement](el: boundElement, scope: Scope[boundElement]) extends NameElement with Proxy with BindingSensitive { - /** Returns the element this `BoundElement' stands for. - * The `Proxy' trait ensures `equals', `hashCode' and `toString' are forwarded to + /** Returns the element this `BoundElement` stands for. + * The `Proxy` trait ensures `equals`, `hashCode` and `toString` are forwarded to * the result of this method. */ def self: Element = scope.getElementFor(el) @@ -222,10 +222,10 @@ trait Binders extends AbstractSyntax with Mappable { override def toString: String = "(" + scope.toString + ") in { "+element.toString+" }" /** Alpha-equivalence -- TODO - * Returns true if the `element' of the `other' `UnderBinder' is equal to this `element' up to alpha-conversion. + * Returns true if the `element` of the `other` `UnderBinder` is equal to this `element` up to alpha-conversion. * - * That is, regular equality is used for all elements but `BoundElement's: such an element is - * equal to a `BoundElement' in `other' if their binders are equal. Binders are equal if they + * That is, regular equality is used for all elements but `BoundElement`s: such an element is + * equal to a `BoundElement` in `other` if their binders are equal. Binders are equal if they * are at the same index in their respective scope. * * Example: UnderBinder([x, y]!1, x@1) alpha_== UnderBinder([a, b]!2, a@2) @@ -291,10 +291,10 @@ trait Binders extends AbstractSyntax with Mappable { def unit[bt <: NameElement, elementT <% Mappable[elementT]](x: elementT) = UnderBinder(new Scope[bt](), x) } - /** If a list of `UnderBinder's all have the same scope, they can be turned in to an UnderBinder - * containing a list of the elements in the original `UnderBinder'. + /** If a list of `UnderBinder`s all have the same scope, they can be turned in to an UnderBinder + * containing a list of the elements in the original `UnderBinder`. * - * The name `sequence' comes from the fact that this method's type is equal to the type of monadic sequence. + * The name `sequence` comes from the fact that this method's type is equal to the type of monadic sequence. * * @note `!orig.isEmpty` implies `orig.forall(ub => ub.scope eq orig(0).scope)` * @@ -307,11 +307,11 @@ trait Binders extends AbstractSyntax with Mappable { def unsequence[bt <: NameElement, st <% Mappable[st]](orig: UnderBinder[bt, List[st]]): List[UnderBinder[bt, st]] = orig.element.map(sc => UnderBinder(orig.scope, sc)) - /** An environment that maps a `NameElement' to the scope in which it is bound. + /** An environment that maps a `NameElement` to the scope in which it is bound. * This can be used to model scoping during parsing. * - * (This class is similar to Burak's ECOOP paper on pattern matching, except that we use `==' - * instead of `eq', thus types can't be unified in general) + * (This class is similar to Burak's ECOOP paper on pattern matching, except that we use `==` + * instead of `eq`, thus types can't be unified in general) * * TODO: more documentation */ diff --git a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala index 7f173dada9..32261c102e 100644 --- a/src/library/scala/util/parsing/combinator/ImplicitConversions.scala +++ b/src/library/scala/util/parsing/combinator/ImplicitConversions.scala @@ -9,17 +9,17 @@ package scala.util.parsing.combinator -/** This object contains implicit conversions that come in handy when using the `^^' combinator +/** This object contains implicit conversions that come in handy when using the `^^` combinator * {@see Parsers} to construct an AST from the concrete syntax. *<p> - * The reason for this is that the sequential composition combinator (`~') combines its constituents - * into a ~. When several `~'s are combined, this results in nested `~'s (to the left). - * The `flatten*' coercions makes it easy to apply an `n'-argument function to a nested ~ of - * depth (`n-1')</p> + * The reason for this is that the sequential composition combinator (`~`) combines its constituents + * into a ~. When several `~`s are combined, this results in nested `~`s (to the left). + * The `flatten*` coercions makes it easy to apply an `n`-argument function to a nested ~ of + * depth (`n-1`)</p> *<p> - * The `headOptionTailToFunList' converts a function that takes a List[A] to a function that + * The `headOptionTailToFunList` converts a function that takes a List[A] to a function that * accepts a ~[A, Option[List[A]]] (this happens when, e.g., parsing something of the following - * shape: p ~ opt("." ~ repsep(p, ".")) -- where `p' is a parser that yields an A)</p> + * shape: p ~ opt("." ~ repsep(p, ".")) -- where `p` is a parser that yields an A)</p> * * @author Martin Odersky, Iulian Dragos, Adriaan Moors */ diff --git a/src/library/scala/util/parsing/combinator/Parsers.scala b/src/library/scala/util/parsing/combinator/Parsers.scala index a02f33ef36..b0760f42ae 100644 --- a/src/library/scala/util/parsing/combinator/Parsers.scala +++ b/src/library/scala/util/parsing/combinator/Parsers.scala @@ -66,19 +66,19 @@ trait Parsers { sealed abstract class ParseResult[+T] { /** Functional composition of ParseResults * - * @param `f' the function to be lifted over this result - * @return `f' applied to the result of this `ParseResult', packaged up as a new `ParseResult' + * @param `f` the function to be lifted over this result + * @return `f` applied to the result of this `ParseResult`, packaged up as a new `ParseResult` */ def map[U](f: T => U): ParseResult[U] /** Partial functional composition of ParseResults * - * @param `f' the partial function to be lifted over this result - * @param error a function that takes the same argument as `f' and produces an error message - * to explain why `f' wasn't applicable (it is called when this is the case) - * @return <i>if `f' f is defined at the result in this `ParseResult',</i> - * `f' applied to the result of this `ParseResult', packaged up as a new `ParseResult'. - * If `f' is not defined, `Failure'. + * @param `f` the partial function to be lifted over this result + * @param error a function that takes the same argument as `f` and produces an error message + * to explain why `f` wasn't applicable (it is called when this is the case) + * @return <i>if `f` f is defined at the result in this `ParseResult`,</i> + * `f` applied to the result of this `ParseResult`, packaged up as a new `ParseResult`. + * If `f` is not defined, `Failure`. */ def mapPartial[U](f: PartialFunction[T, U], error: T => String): ParseResult[U] @@ -167,7 +167,7 @@ trait Parsers { } /** The fatal failure case of ParseResult: contains an error-message and the remaining input. - * No back-tracking is done when a parser returns an `Error' + * No back-tracking is done when a parser returns an `Error` * * @param msg An error message string describing the error. * @param next The parser's unconsumed input at the point where the error occurred. @@ -215,43 +215,41 @@ trait Parsers { // it's short, light (looks like whitespace), has few overloaded meaning (thanks to the recent change from ~ to unary_~) // and we love it! (or do we like `,` better?) - /** A parser combinator for sequential composition + /** A parser combinator for sequential composition. * - * <p> `p ~ q' succeeds if `p' succeeds and `q' succeeds on the input - * left over by `p'.</p> + * `p ~ q` succeeds if `p` succeeds and `q` succeeds on the input left over by `p`. * - * @param q a parser that will be executed after `p' (this parser) succeeds -- evaluated at most once, and only when necessary - * @return a `Parser' that -- on success -- returns a `~' (like a Pair, but easier to pattern match on) - * that contains the result of `p' and that of `q'. - * The resulting parser fails if either `p' or `q' fails. + * @param q a parser that will be executed after `p` (this parser) succeeds -- evaluated at most once, and only when necessary + * @return a `Parser` that -- on success -- returns a `~` (like a Pair, but easier to pattern match on) + * that contains the result of `p` and that of `q`. + * The resulting parser fails if either `p` or `q` fails. */ @migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.") def ~ [U](q: => Parser[U]): Parser[~[T, U]] = { lazy val p = q // lazy argument (for(a <- this; b <- p) yield new ~(a,b)).named("~") } - /** A parser combinator for sequential composition which keeps only the right result + /** A parser combinator for sequential composition which keeps only the right result. * - * <p> `p ~> q' succeeds if `p' succeeds and `q' succeeds on the input - * left over by `p'.</p> + * `p ~> q` succeeds if `p` succeeds and `q` succeeds on the input left over by `p`. * - * @param q a parser that will be executed after `p' (this parser) succeeds -- evaluated at most once, and only when necessary - * @return a `Parser' that -- on success -- returns the result of `q'. + * @param q a parser that will be executed after `p` (this parser) succeeds -- evaluated at most once, and only when necessary + * @return a `Parser` that -- on success -- returns the result of `q`. */ @migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.") def ~> [U](q: => Parser[U]): Parser[U] = { lazy val p = q // lazy argument (for(a <- this; b <- p) yield b).named("~>") } - /** A parser combinator for sequential composition which keeps only the left result + /** A parser combinator for sequential composition which keeps only the left result. * - * <p> `p <~ q' succeeds if `p' succeeds and `q' succeeds on the input - * left over by `p'.</p> + * <p> `p <~ q` succeeds if `p` succeeds and `q` succeeds on the input + * left over by `p`.</p> * - * <b>Note:</b> <~ has lower operator precedence than ~ or ~>. + * '''Note:''' <~ has lower operator precedence than ~ or ~>. * - * @param q a parser that will be executed after `p' (this parser) succeeds -- evaluated at most once, and only when necessary - * @return a `Parser' that -- on success -- returns the result of `p'. + * @param q a parser that will be executed after `p` (this parser) succeeds -- evaluated at most once, and only when necessary + * @return a `Parser` that -- on success -- returns the result of `p`. */ @migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.") def <~ [U](q: => Parser[U]): Parser[T] = { lazy val p = q // lazy argument @@ -263,43 +261,40 @@ trait Parsers { def apply(in: Input) = seq(Parser.this, q)((x, y) => combine(x,y))(in) } */ - /** A parser combinator for non-back-tracking sequential composition + /** A parser combinator for non-back-tracking sequential composition. * - *<p>`p ~! q' succeeds if `p' succeeds and `q' succeeds on the input - * left over by `p'. In case of failure, no back-tracking is performed - * (in an earlier parser produced by the | combinator).</p> + * `p ~! q` succeeds if `p` succeeds and `q` succeeds on the input left over by `p`. + * In case of failure, no back-tracking is performed (in an earlier parser produced by the `|` combinator). * - * @param q a parser that will be executed after `p' (this parser) succeeds - * @return a `Parser' that -- on success -- returns a `~' (like a Pair, but easier to pattern match on) - * that contains the result of `p' and that of `q'. - * The resulting parser fails if either `p' or `q' fails, this failure is fatal. + * @param q a parser that will be executed after `p` (this parser) succeeds + * @return a `Parser` that -- on success -- returns a `~` (like a Pair, but easier to pattern match on) + * that contains the result of `p` and that of `q`. + * The resulting parser fails if either `p` or `q` fails, this failure is fatal. */ def ~! [U](p: => Parser[U]): Parser[~[T, U]] = OnceParser{ (for(a <- this; b <- commit(p)) yield new ~(a,b)).named("~!") } - /** A parser combinator for alternative composition + /** A parser combinator for alternative composition. * - *<p>`p | q' succeeds if `p' succeeds or `q' succeeds - * Note that `q' is only tried if `p's failure is non-fatal (i.e., back-tracking is - * allowed).</p> + * `p | q` succeeds if `p` succeeds or `q` succeeds. + * Note that `q` is only tried if `p`s failure is non-fatal (i.e., back-tracking is allowed). * - * @param q a parser that will be executed if `p' (this parser) fails (and allows back-tracking) - * @return a `Parser' that returns the result of the first parser to succeed (out of `p' and `q') + * @param q a parser that will be executed if `p` (this parser) fails (and allows back-tracking) + * @return a `Parser` that returns the result of the first parser to succeed (out of `p` and `q`) * The resulting parser succeeds if (and only if) <ul> - * <li> `p' succeeds, <i>or</i> </li> - * <li> if `p' fails allowing back-tracking and `q' succeeds. </li> </ul> + * <li> `p` succeeds, <i>or</i> </li> + * <li> if `p` fails allowing back-tracking and `q` succeeds. </li> </ul> */ def | [U >: T](q: => Parser[U]): Parser[U] = append(q).named("|") // TODO - /** A parser combinator for alternative with longest match composition + /** A parser combinator for alternative with longest match composition. * - *<p>`p ||| q' succeeds if `p' succeeds or `q' succeeds - * If `p' and `q' both succeed, the parser that consumed the most - * characters accepts.</p> + * `p ||| q` succeeds if `p` succeeds or `q` succeeds. + * If `p` and `q` both succeed, the parser that consumed the most characters accepts. * * @param q0 a parser that accepts if p consumes less characters. -- evaluated at most once, and only when necessary - * @return a `Parser' that returns the result of the parser consuming the most characters (out of `p' and `q'). + * @return a `Parser` that returns the result of the parser consuming the most characters (out of `p` and `q`). */ @migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.") def ||| [U >: T](q0: => Parser[U]): Parser[U] = new Parser[U] { @@ -319,20 +314,21 @@ trait Parsers { override def toString = "|||" } - /** A parser combinator for function application + /** A parser combinator for function application. * - *<p>`p ^^ f' succeeds if `p' succeeds; it returns `f' applied to the result of `p'.</p> + * `p ^^ f` succeeds if `p` succeeds; it returns `f` applied to the result of `p`. * - * @param f a function that will be applied to this parser's result (see `map' in `ParseResult'). + * @param f a function that will be applied to this parser's result (see `map` in `ParseResult`). * @return a parser that has the same behaviour as the current parser, but whose result is - * transformed by `f'. + * transformed by `f`. */ def ^^ [U](f: T => U): Parser[U] = map(f).named(toString+"^^") /** A parser combinator that changes a successful result into the specified value. * - * <p>`p ^^^ v' succeeds if `p' succeeds; discards its result, and returns `v` instead.</p> + * `p ^^^ v` succeeds if `p` succeeds; discards its result, and returns `v` instead. + * * @param v The new result for the parser, evaluated at most once (if `p` succeeds), not evaluated at all if `p` fails. * @return a parser that has the same behaviour as the current parser, but whose successful result is `v` */ @@ -342,48 +338,47 @@ trait Parsers { def apply(in: Input) = Parser.this(in) map (x => v0) }.named(toString+"^^^") - /** A parser combinator for partial function application + /** A parser combinator for partial function application. * - *<p>`p ^? (f, error)' succeeds if `p' succeeds AND `f' is defined at the result of `p'; - * in that case, it returns `f' applied to the result of `p'. If `f' is not applicable, - * error(the result of `p') should explain why.</p> + * `p ^? (f, error)` succeeds if `p` succeeds AND `f` is defined at the result of `p`; + * in that case, it returns `f` applied to the result of `p`. If `f` is not applicable, + * error(the result of `p`) should explain why. * * @param f a partial function that will be applied to this parser's result - * (see `mapPartial' in `ParseResult'). - * @param error a function that takes the same argument as `f' and produces an error message - * to explain why `f' wasn't applicable - * @return a parser that succeeds if the current parser succeeds <i>and</i> `f' is applicable - * to the result. If so, the result will be transformed by `f'. + * (see `mapPartial` in `ParseResult`). + * @param error a function that takes the same argument as `f` and produces an error message + * to explain why `f` wasn't applicable + * @return a parser that succeeds if the current parser succeeds <i>and</i> `f` is applicable + * to the result. If so, the result will be transformed by `f`. */ def ^? [U](f: PartialFunction[T, U], error: T => String): Parser[U] = Parser{ in => this(in).mapPartial(f, error)}.named(toString+"^?") - /** A parser combinator for partial function application + /** A parser combinator for partial function application. * - *<p>`p ^? f' succeeds if `p' succeeds AND `f' is defined at the result of `p'; - * in that case, it returns `f' applied to the result of `p'.</p> + * `p ^? f` succeeds if `p` succeeds AND `f` is defined at the result of `p`; + * in that case, it returns `f` applied to the result of `p`. * * @param f a partial function that will be applied to this parser's result - * (see `mapPartial' in `ParseResult'). - * @return a parser that succeeds if the current parser succeeds <i>and</i> `f' is applicable - * to the result. If so, the result will be transformed by `f'. + * (see `mapPartial` in `ParseResult`). + * @return a parser that succeeds if the current parser succeeds <i>and</i> `f` is applicable + * to the result. If so, the result will be transformed by `f`. */ def ^? [U](f: PartialFunction[T, U]): Parser[U] = ^?(f, r => "Constructor function not defined at "+r) - /** A parser combinator that parameterizes a subsequent parser with the result of this one + /** A parser combinator that parameterizes a subsequent parser with the result of this one. * - *<p> - * Use this combinator when a parser depends on the result of a previous parser. `p' should be - * a function that takes the result from the first parser and returns the second parser.</p> + * Use this combinator when a parser depends on the result of a previous parser. `p` should be + * a function that takes the result from the first parser and returns the second parser. * - *<p> `p into fq' (with `fq' typically `{x => q}') first applies `p', and then, if `p' successfully - * returned result `r', applies `fq(r)' to the rest of the input. </p> + * `p into fq` (with `fq` typically `{x => q}') first applies `p`, and then, if `p` successfully + * returned result `r`, applies `fq(r)` to the rest of the input. * - *<p> From: G. Hutton. Higher-order functions for parsing. J. Funct. Program., 2(3):323--343, 1992. </p> + * ''From: G. Hutton. Higher-order functions for parsing. J. Funct. Program., 2(3):323--343, 1992.'' * * @param fq a function that, given the result from this parser, returns the second parser to be applied - * @return a parser that succeeds if this parser succeeds (with result `x') and if then `fq(x)' succeeds + * @return a parser that succeeds if this parser succeeds (with result `x`) and if then `fq(x)` succeeds */ def into[U](fq: T => Parser[U]): Parser[U] = flatMap(fq) @@ -399,8 +394,8 @@ trait Parsers { */ def * = rep(this) - /** Returns a parser that repeatedly parses what this parser parses, interleaved with the `sep' parser. - * The `sep' parser specifies how the results parsed by this parser should be combined. + /** Returns a parser that repeatedly parses what this parser parses, interleaved with the `sep` parser. + * The `sep` parser specifies how the results parsed by this parser should be combined. * * @return chainl1(this, sep) */ @@ -421,8 +416,8 @@ trait Parsers { def ? = opt(this) } - /** Wrap a parser so that its failures become errors (the | combinator will give up as soon as - * it encounters an error, on failure it simply tries the next alternative) + /** Wrap a parser so that its failures become errors (the `|` combinator will give up as soon as + * it encounters an error, on failure it simply tries the next alternative). */ def commit[T](p: => Parser[T]) = Parser{ in => p(in) match{ @@ -437,9 +432,9 @@ trait Parsers { case class EFNil(res: Boolean) extends ElemFun*/ - /** A parser matching input elements that satisfy a given predicate + /** A parser matching input elements that satisfy a given predicate. * - * <p>elem(kind, p) succeeds if the input starts with an element `e' for which p(e) is true.</p> + * `elem(kind, p)` succeeds if the input starts with an element `e` for which p(e) is true. * * @param kind The element kind, used for error messages * @param p A predicate that determines which elements match. @@ -447,49 +442,48 @@ trait Parsers { */ def elem(kind: String, p: Elem => Boolean) = acceptIf(p)(inEl => kind+" expected") - /** A parser that matches only the given element `e' + /** A parser that matches only the given element `e`. * - * <p>elem(e) succeeds if the input starts with an element `e'</p> + * `elem(e)` succeeds if the input starts with an element `e`. * - * @param e the `Elem' that must be the next piece of input for the returned parser to succeed - * @return a `Parser' that succeeds if `e' is the next available input (and returns it). + * @param e the `Elem` that must be the next piece of input for the returned parser to succeed + * @return a `Parser` that succeeds if `e` is the next available input (and returns it). */ def elem(e: Elem): Parser[Elem] = accept(e) - - /** A parser that matches only the given element `e' - *<p> + /** A parser that matches only the given element `e`. + * * The method is implicit so that elements can automatically be lifted to their parsers. - * For example, when parsing `Token's, Identifier("new") (which is a `Token') can be used directly, - * instead of first creating a `Parser' using accept(Identifier("new")).</p> + * For example, when parsing `Token`s, `Identifier("new")` (which is a `Token`) can be used directly, + * instead of first creating a `Parser` using `accept(Identifier("new"))`. * - * @param e the `Elem' that must be the next piece of input for the returned parser to succeed - * @return a `tParser' that succeeds if `e' is the next available input. + * @param e the `Elem` that must be the next piece of input for the returned parser to succeed + * @return a `tParser` that succeeds if `e` is the next available input. */ implicit def accept(e: Elem): Parser[Elem] = acceptIf(_ == e)("`"+e+"' expected but " + _ + " found") - /** A parser that matches only the given list of element `es' + /** A parser that matches only the given list of element `es`. * - * <p>accept(es) succeeds if the input subsequently provides the elements in the list `es'.</p> + * `accept(es)` succeeds if the input subsequently provides the elements in the list `es`. * * @param es the list of expected elements * @return a Parser that recognizes a specified list of elements */ def accept[ES <% List[Elem]](es: ES): Parser[List[Elem]] = acceptSeq(es) - /** The parser that matches an element in the domain of the partial function `f' - *<p> - * If `f' is defined on the first element in the input, `f' is applied to it to produce - * this parser's result.</p> - *<p> - * Example: The parser <code>accept("name", {case Identifier(n) => Name(n)})</code> - * accepts an <code>Identifier(n)</code> and returns a <code>Name(n)</code>.</p> + /** The parser that matches an element in the domain of the partial function `f`. + * + * If `f` is defined on the first element in the input, `f` is applied to it to produce + * this parser's result. + * + * Example: The parser `accept("name", {case Identifier(n) => Name(n)})` + * accepts an `Identifier(n)` and returns a `Name(n)` * * @param expected a description of the kind of element this parser expects (for error messages) * @param f a partial function that determines when this parser is successful and what its output is - * @return A parser that succeeds if `f' is applicable to the first element of the input, - * applying `f' to it to produce the result. + * @return A parser that succeeds if `f` is applicable to the first element of the input, + * applying `f` to it to produce the result. */ def accept[U](expected: String, f: PartialFunction[Elem, U]): Parser[U] = acceptMatch(expected, f) @@ -506,14 +500,14 @@ trait Parsers { def acceptSeq[ES <% Iterable[Elem]](es: ES): Parser[List[Elem]] = es.foldRight[Parser[List[Elem]]](success(Nil)){(x, pxs) => accept(x) ~ pxs ^^ mkList} - /** A parser that always fails + /** A parser that always fails. * * @param msg The error message describing the failure. * @return A parser that always fails with the specified error message. */ def failure(msg: String) = Parser{ in => Failure(msg, in) } - /** A parser that results in an error + /** A parser that results in an error. * * @param msg The error message describing the failure. * @return A parser that always fails with the specified error message. @@ -521,10 +515,10 @@ trait Parsers { def err(msg: String) = Parser{ in => Error(msg, in) } - /** A parser that always succeeds + /** A parser that always succeeds. * * @param v The result for the parser - * @return A parser that always succeeds, with the given result `v' + * @return A parser that always succeeds, with the given result `v` */ def success[T](v: T) = Parser{ in => Success(v, in) } @@ -537,52 +531,50 @@ trait Parsers { /** A parser generator for repetitions. * - * <p> rep(p) repeatedly uses `p' to parse the input until `p' fails (the result is a List - * of the consecutive results of `p') </p> + * `rep(p)` repeatedly uses `p` to parse the input until `p` fails (the result is a List + * of the consecutive results of `p`). * - * @param p a `Parser' that is to be applied successively to the input - * @return A parser that returns a list of results produced by repeatedly applying `p' to the input. + * @param p a `Parser` that is to be applied successively to the input + * @return A parser that returns a list of results produced by repeatedly applying `p` to the input. */ def rep[T](p: => Parser[T]): Parser[List[T]] = rep1(p) | success(List()) /** A parser generator for interleaved repetitions. * - * <p> repsep(p, q) repeatedly uses `p' interleaved with `q' to parse the input, until `p' fails. - * (The result is a `List' of the results of `p'.) </p> + * `repsep(p, q)` repeatedly uses `p` interleaved with `q` to parse the input, until `p` fails. + * (The result is a `List` of the results of `p`.) * - * <p>Example: <code>repsep(term, ",")</code> parses a comma-separated list of term's, - * yielding a list of these terms</p> + * Example: `repsep(term, ",")` parses a comma-separated list of term's, yielding a list of these terms. * - * @param p a `Parser' that is to be applied successively to the input - * @param q a `Parser' that parses the elements that separate the elements parsed by `p' - * @return A parser that returns a list of results produced by repeatedly applying `p' (interleaved - * with `q') to the input. - * The results of `p' are collected in a list. The results of `q' are discarded. + * @param p a `Parser` that is to be applied successively to the input + * @param q a `Parser` that parses the elements that separate the elements parsed by `p` + * @return A parser that returns a list of results produced by repeatedly applying `p` (interleaved with `q`) to the input. + * The results of `p` are collected in a list. The results of `q` are discarded. */ def repsep[T](p: => Parser[T], q: => Parser[Any]): Parser[List[T]] = rep1sep(p, q) | success(List()) /** A parser generator for non-empty repetitions. * - * <p> rep1(p) repeatedly uses `p' to parse the input until `p' fails -- `p' must succeed at least - * once (the result is a `List' of the consecutive results of `p')</p> + * <p> rep1(p) repeatedly uses `p` to parse the input until `p` fails -- `p` must succeed at least + * once (the result is a `List` of the consecutive results of `p`)</p> * - * @param p a `Parser' that is to be applied successively to the input - * @return A parser that returns a list of results produced by repeatedly applying `p' to the input - * (and that only succeeds if `p' matches at least once). + * @param p a `Parser` that is to be applied successively to the input + * @return A parser that returns a list of results produced by repeatedly applying `p` to the input + * (and that only succeeds if `p` matches at least once). */ def rep1[T](p: => Parser[T]): Parser[List[T]] = rep1(p, p) /** A parser generator for non-empty repetitions. * - * <p> rep1(f, p) first uses `f' (which must succeed) and then repeatedly uses `p' to - * parse the input until `p' fails - * (the result is a `List' of the consecutive results of `f' and `p')</p> + * <p> rep1(f, p) first uses `f` (which must succeed) and then repeatedly uses `p` to + * parse the input until `p` fails + * (the result is a `List` of the consecutive results of `f` and `p`)</p> * - * @param first a `Parser' that parses the first piece of input - * @param p0 a `Parser' that is to be applied successively to the rest of the input (if any) -- evaluated at most once, and only when necessary - * @return A parser that returns a list of results produced by first applying `f' and then - * repeatedly `p' to the input (it only succeeds if `f' matches). + * @param first a `Parser` that parses the first piece of input + * @param p0 a `Parser` that is to be applied successively to the rest of the input (if any) -- evaluated at most once, and only when necessary + * @return A parser that returns a list of results produced by first applying `f` and then + * repeatedly `p` to the input (it only succeeds if `f` matches). */ @migration(2, 9, "As of 2.9, the p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.") def rep1[T](first: => Parser[T], p0: => Parser[T]): Parser[List[T]] = Parser { in => @@ -607,13 +599,13 @@ trait Parsers { /** A parser generator for a specified number of repetitions. * - * <p> repN(n, p) uses `p' exactly `n' time to parse the input - * (the result is a `List' of the `n' consecutive results of `p')</p> + * `repN(n, p)` uses `p` exactly `n` time to parse the input + * (the result is a `List` of the `n` consecutive results of `p`). * - * @param p a `Parser' that is to be applied successively to the input - * @param n the exact number of times `p' must succeed - * @return A parser that returns a list of results produced by repeatedly applying `p' to the input - * (and that only succeeds if `p' matches exactly `n' times). + * @param p a `Parser` that is to be applied successively to the input + * @param n the exact number of times `p` must succeed + * @return A parser that returns a list of results produced by repeatedly applying `p` to the input + * (and that only succeeds if `p` matches exactly `n` times). */ def repN[T](num: Int, p: => Parser[T]): Parser[List[T]] = if (num == 0) success(Nil) else Parser { in => @@ -632,24 +624,24 @@ trait Parsers { /** A parser generator for non-empty repetitions. * - * <p>rep1sep(p, q) repeatedly applies `p' interleaved with `q' to parse the input, until `p' fails. - * The parser `p' must succeed at least once.</p> + * `rep1sep(p, q)` repeatedly applies `p` interleaved with `q` to parse the input, until `p` fails. + * The parser `p` must succeed at least once. * - * @param p a `Parser' that is to be applied successively to the input - * @param q a `Parser' that parses the elements that separate the elements parsed by `p' - * (interleaved with `q') - * @return A parser that returns a list of results produced by repeatedly applying `p' to the input - * (and that only succeeds if `p' matches at least once). - * The results of `p' are collected in a list. The results of `q' are discarded. + * @param p a `Parser` that is to be applied successively to the input + * @param q a `Parser` that parses the elements that separate the elements parsed by `p` + * (interleaved with `q`) + * @return A parser that returns a list of results produced by repeatedly applying `p` to the input + * (and that only succeeds if `p` matches at least once). + * The results of `p` are collected in a list. The results of `q` are discarded. */ def rep1sep[T](p : => Parser[T], q : => Parser[Any]): Parser[List[T]] = p ~ rep(q ~> p) ^^ {case x~y => x::y} - - /** A parser generator that, roughly, generalises the rep1sep generator so that `q', which parses the separator, - * produces a left-associative function that combines the elements it separates. + /** A parser generator that, roughly, generalises the rep1sep generator so that `q`, which parses the separator, + * produces a left-associative function that combines the elements it separates. * - * <p> From: J. Fokker. Functional parsers. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, volume 925 of Lecture Notes in Computer Science, pages 1--23. Springer, 1995.</p> + * ''From: J. Fokker. Functional parsers. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, + * volume 925 of Lecture Notes in Computer Science, pages 1--23. Springer, 1995.'' * * @param p a parser that parses the elements * @param q a parser that parses the token(s) separating the elements, yielding a left-associative function that @@ -658,7 +650,7 @@ trait Parsers { def chainl1[T](p: => Parser[T], q: => Parser[(T, T) => T]): Parser[T] = chainl1(p, p, q) - /** A parser generator that, roughly, generalises the rep1sep generator so that `q', which parses the separator, + /** A parser generator that, roughly, generalises the `rep1sep` generator so that `q`, which parses the separator, * produces a left-associative function that combines the elements it separates. * * @param first a parser that parses the first element @@ -671,7 +663,7 @@ trait Parsers { case x ~ xs => xs.foldLeft(x){(_, _) match {case (a, f ~ b) => f(a, b)}} } - /** A parser generator that generalises the rep1sep generator so that `q', which parses the separator, + /** A parser generator that generalises the `rep1sep` generator so that `q`, which parses the separator, * produces a right-associative function that combines the elements it separates. Additionally, * The right-most (last) element and the left-most combining function have to be supplied. * @@ -691,16 +683,16 @@ trait Parsers { /** A parser generator for optional sub-phrases. * - * <p>opt(p) is a parser that returns `Some(x)' if `p' returns `x' and `None' if `p' fails</p> + * `opt(p)` is a parser that returns `Some(x)` if `p` returns `x` and `None` if `p` fails. * - * @param p A `Parser' that is tried on the input - * @return a `Parser' that always succeeds: either with the result provided by `p' or + * @param p A `Parser` that is tried on the input + * @return a `Parser` that always succeeds: either with the result provided by `p` or * with the empty result */ def opt[T](p: => Parser[T]): Parser[Option[T]] = p ^^ (x => Some(x)) | success(None) - /** Wrap a parser so that its failures&errors become success and vice versa -- it never consumes any input + /** Wrap a parser so that its failures and errors become success and vice versa -- it never consumes any input. */ def not[T](p: => Parser[T]): Parser[Unit] = Parser { in => p(in) match { @@ -712,8 +704,8 @@ trait Parsers { /** A parser generator for guard expressions. The resulting parser will fail or succeed * just like the one given as parameter but it will not consume any input. * - * @param p a `Parser' that is to be applied to the input - * @return A parser that returns success if and only if 'p' succeeds but never consumes any input + * @param p a `Parser` that is to be applied to the input + * @return A parser that returns success if and only if `p` succeeds but never consumes any input */ def guard[T](p: => Parser[T]): Parser[T] = Parser { in => p(in) match{ @@ -723,10 +715,10 @@ trait Parsers { } - /** `positioned' decorates a parser's result with the start position of the input it consumed. + /** `positioned` decorates a parser's result with the start position of the input it consumed. * - * @param p a `Parser' whose result conforms to `Positional'. - * @return A parser that has the same behaviour as `p', but which marks its result with the + * @param p a `Parser` whose result conforms to `Positional`. + * @return A parser that has the same behaviour as `p`, but which marks its result with the * start position of the input it consumed, if it didn't already have a position. */ def positioned[T <: Positional](p: => Parser[T]): Parser[T] = Parser { in => @@ -736,18 +728,14 @@ trait Parsers { } } - /** <p> - * A parser generator delimiting whole phrases (i.e. programs). - * </p> - * <p> - * <code>phrase(p)</code> succeeds if <code>p</code> succeeds and - * no input is left over after <code>p</code>. - * </p> + /** A parser generator delimiting whole phrases (i.e. programs). + * + * `phrase(p)` succeeds if `p` succeeds and no input is left over after `p`. * * @param p the parser that must consume all input for the resulting parser * to succeed. - * @return a parser that has the same result as `p', but that only succeeds - * if <code>p</code> consumed all the input. + * @return a parser that has the same result as `p`, but that only succeeds + * if `p` consumed all the input. */ def phrase[T](p: Parser[T]) = new Parser[T] { lastNoSuccess = null @@ -768,7 +756,7 @@ trait Parsers { override def toString = "("+ _1 +"~"+ _2 +")" } - /** A parser whose ~ combinator disallows back-tracking. + /** A parser whose `~` combinator disallows back-tracking. */ trait OnceParser[+T] extends Parser[T] { override def ~ [U](p: => Parser[U]): Parser[~[T, U]] diff --git a/src/library/scala/util/parsing/combinator/RegexParsers.scala b/src/library/scala/util/parsing/combinator/RegexParsers.scala index 134e7e6323..83155470e8 100644 --- a/src/library/scala/util/parsing/combinator/RegexParsers.scala +++ b/src/library/scala/util/parsing/combinator/RegexParsers.scala @@ -69,10 +69,10 @@ trait RegexParsers extends Parsers { } } - /** `positioned' decorates a parser's result with the start position of the input it consumed. + /** `positioned` decorates a parser's result with the start position of the input it consumed. * If whitespace is being skipped, then it is skipped before the start position is recorded. * - * @param p a `Parser' whose result conforms to `Positional'. + * @param p a `Parser` whose result conforms to `Positional'. * @return A parser that has the same behaviour as `p', but which marks its result with the * start position of the input it consumed after whitespace has been skipped, if it * didn't already have a position. @@ -91,27 +91,27 @@ trait RegexParsers extends Parsers { override def phrase[T](p: Parser[T]): Parser[T] = super.phrase(p <~ opt("""\z""".r)) - /** Parse some prefix of reader `in' with parser `p' */ + /** Parse some prefix of reader `in` with parser `p`. */ def parse[T](p: Parser[T], in: Reader[Char]): ParseResult[T] = p(in) - /** Parse some prefix of character sequence `in' with parser `p' */ + /** Parse some prefix of character sequence `in` with parser `p`. */ def parse[T](p: Parser[T], in: java.lang.CharSequence): ParseResult[T] = p(new CharSequenceReader(in)) - /** Parse some prefix of reader `in' with parser `p' */ + /** Parse some prefix of reader `in` with parser `p`. */ def parse[T](p: Parser[T], in: java.io.Reader): ParseResult[T] = p(new PagedSeqReader(PagedSeq.fromReader(in))) - /** Parse all of reader `in' with parser `p' */ + /** Parse all of reader `in` with parser `p`. */ def parseAll[T](p: Parser[T], in: Reader[Char]): ParseResult[T] = parse(phrase(p), in) - /** Parse all of reader `in' with parser `p' */ + /** Parse all of reader `in` with parser `p`. */ def parseAll[T](p: Parser[T], in: java.io.Reader): ParseResult[T] = parse(phrase(p), in) - /** Parse all of character sequence `in' with parser `p' */ + /** Parse all of character sequence `in` with parser `p`. */ def parseAll[T](p: Parser[T], in: java.lang.CharSequence): ParseResult[T] = parse(phrase(p), in) } diff --git a/src/library/scala/util/parsing/combinator/lexical/Lexical.scala b/src/library/scala/util/parsing/combinator/lexical/Lexical.scala index 8c6be7f8eb..917a4d3a44 100644 --- a/src/library/scala/util/parsing/combinator/lexical/Lexical.scala +++ b/src/library/scala/util/parsing/combinator/lexical/Lexical.scala @@ -34,7 +34,7 @@ abstract class Lexical extends Scanners with Tokens { /** A character-parser that matches a digit (and returns it)*/ def digit = elem("digit", _.isDigit) - /** A character-parser that matches any character except the ones given in `cs' (and returns it)*/ + /** A character-parser that matches any character except the ones given in `cs` (and returns it)*/ def chrExcept(cs: Char*) = elem("", ch => (cs forall (ch !=))) /** A character-parser that matches a white-space character (and returns it)*/ diff --git a/src/library/scala/util/parsing/combinator/lexical/Scanners.scala b/src/library/scala/util/parsing/combinator/lexical/Scanners.scala index 1b1a77771c..80331e4e7c 100644 --- a/src/library/scala/util/parsing/combinator/lexical/Scanners.scala +++ b/src/library/scala/util/parsing/combinator/lexical/Scanners.scala @@ -39,12 +39,12 @@ trait Scanners extends Parsers { def whitespace: Parser[Any] /** <p> - * <code>Scanner</code> is essentially(*) a parser that produces `Token's + * <code>Scanner</code> is essentially(*) a parser that produces `Token`s * from a stream of characters. The tokens it produces are typically * passed to parsers in <code>TokenParsers</code>. * </p> * <p> - * Note: (*) <code>Scanner</code> is really a `Reader' of `Token's + * Note: (*) <code>Scanner</code> is really a `Reader` of `Token`s * </p> */ class Scanner(in: Reader[Char]) extends Reader[Token] { diff --git a/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala b/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala index 8e93ccb173..8ff0ff4321 100644 --- a/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala +++ b/src/library/scala/util/parsing/combinator/lexical/StdLexical.scala @@ -22,9 +22,9 @@ import collection.mutable.HashSet * </p> * <p> * To distinguish between identifiers and keywords, it uses a set of reserved identifiers: - * every string contained in `reserved' is returned as a keyword token. + * every string contained in `reserved` is returned as a keyword token. * (Note that "=>" is hard-coded as a keyword.) - * Additionally, the kinds of delimiters can be specified by the `delimiters' set. + * Additionally, the kinds of delimiters can be specified by the `delimiters` set. * </p> * <p> * Usually this component is used to break character-based input into bigger tokens, @@ -34,7 +34,7 @@ import collection.mutable.HashSet * @author Martin Odersky, Iulian Dragos, Adriaan Moors */ class StdLexical extends Lexical with StdTokens { - // see `token' in `Scanners' + // see `token` in `Scanners` def token: Parser[Token] = ( identChar ~ rep( identChar | digit ) ^^ { case first ~ rest => processIdent(first :: rest mkString "") } | digit ~ rep( digit ) ^^ { case first ~ rest => NumericLit(first :: rest mkString "") } @@ -50,7 +50,7 @@ class StdLexical extends Lexical with StdTokens { // legal identifier chars other than digits def identChar = letter | elem('_') - // see `whitespace in `Scanners' + // see `whitespace in `Scanners` def whitespace: Parser[Any] = rep( whitespaceChar | '/' ~ '*' ~ comment @@ -63,7 +63,7 @@ class StdLexical extends Lexical with StdTokens { | chrExcept(EofCh) ~ comment ) - /** The set of reserved identifiers: these will be returned as `Keyword's */ + /** The set of reserved identifiers: these will be returned as `Keyword`s */ val reserved = new HashSet[String] /** The set of delimiters (ordering does not matter) */ diff --git a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala index 5db62682f8..e494a69cf0 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StandardTokenParsers.scala @@ -14,7 +14,7 @@ package syntactical import token._ import lexical.StdLexical -/** This component provides primitive parsers for the standard tokens defined in `StdTokens'. +/** This component provides primitive parsers for the standard tokens defined in `StdTokens`. * * @author Martin Odersky, Adriaan Moors */ diff --git a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala index 0938d587bf..c57fc14f5e 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/StdTokenParsers.scala @@ -15,7 +15,7 @@ package syntactical import token._ import collection.mutable.HashMap -/** This component provides primitive parsers for the standard tokens defined in `StdTokens'. +/** This component provides primitive parsers for the standard tokens defined in `StdTokens`. * * @author Martin Odersky, Adriaan Moors */ @@ -28,7 +28,7 @@ trait StdTokenParsers extends TokenParsers { /** A parser which matches a single keyword token. * * @param chars The character string making up the matched keyword. - * @return a `Parser' that matches the given string + * @return a `Parser` that matches the given string */ // implicit def keyword(chars: String): Parser[String] = accept(Keyword(chars)) ^^ (_.chars) implicit def keyword(chars: String): Parser[String] = diff --git a/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala b/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala index 430b01fda1..550589ea66 100644 --- a/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala +++ b/src/library/scala/util/parsing/combinator/syntactical/TokenParsers.scala @@ -16,7 +16,7 @@ package syntactical * @author Martin Odersky, Adriaan Moors */ trait TokenParsers extends Parsers { - /** Tokens is the abstract type of the `Token's consumed by the parsers in this component*/ + /** Tokens is the abstract type of the `Token`s consumed by the parsers in this component. */ type Tokens <: token.Tokens /** lexical is the component responsible for consuming some basic kind of diff --git a/src/library/scala/util/parsing/combinator/testing/Tester.scala b/src/library/scala/util/parsing/combinator/testing/Tester.scala index 8b96a2c241..490442482a 100644 --- a/src/library/scala/util/parsing/combinator/testing/Tester.scala +++ b/src/library/scala/util/parsing/combinator/testing/Tester.scala @@ -25,7 +25,7 @@ import scala.util.parsing.combinator.syntactical.TokenParsers * </p><pre> * <b>val</b> parser = syntactic.term</pre> * <p> - * (if MyParsers extends TokenParsers with a parser called `term') + * (if MyParsers extends TokenParsers with a parser called `term`) * </p> * * @author Martin Odersky, Adriaan Moors @@ -36,7 +36,7 @@ abstract class Tester { val parser: syntactic.Parser[Any] - /** Scans a String (using a `syntactic.lexical.Scanner'), parses it + /** Scans a String (using a `syntactic.lexical.Scanner`), parses it * using <code>phrase(parser)</code>, and prints the input and the * parsed result to the console. */ diff --git a/src/library/scala/util/parsing/combinator/token/StdTokens.scala b/src/library/scala/util/parsing/combinator/token/StdTokens.scala index a6bea0a91a..4ce62659f6 100644 --- a/src/library/scala/util/parsing/combinator/token/StdTokens.scala +++ b/src/library/scala/util/parsing/combinator/token/StdTokens.scala @@ -10,7 +10,7 @@ package scala.util.parsing package combinator package token -/** This component provides the standard `Token's for a simple, Scala-like language. +/** This component provides the standard `Token`s for a simple, Scala-like language. * * @author Martin Odersky, Adriaan Moors */ diff --git a/src/library/scala/util/parsing/combinator/token/Tokens.scala b/src/library/scala/util/parsing/combinator/token/Tokens.scala index f5bbb953d2..ad05427fa1 100644 --- a/src/library/scala/util/parsing/combinator/token/Tokens.scala +++ b/src/library/scala/util/parsing/combinator/token/Tokens.scala @@ -10,8 +10,8 @@ package scala.util.parsing package combinator package token -/** This component provides the notion of `Token', the unit of information that is passed from lexical - * parsers in the `Lexical' component to the parsers in the `TokenParsers' component. +/** This component provides the notion of `Token`, the unit of information that is passed from lexical + * parsers in the `Lexical` component to the parsers in the `TokenParsers` component. * * @author Martin Odersky, Adriaan Moors */ diff --git a/src/library/scala/util/parsing/input/CharArrayReader.scala b/src/library/scala/util/parsing/input/CharArrayReader.scala index 6e11435c51..67629eacd4 100644 --- a/src/library/scala/util/parsing/input/CharArrayReader.scala +++ b/src/library/scala/util/parsing/input/CharArrayReader.scala @@ -21,9 +21,9 @@ object CharArrayReader { * from an array. * * @param source an array of characters - * @param index starting offset into the array; the first element returned will be `source(index)' - * @param line the line number of the first element (counting from index `0' of `source') - * @param column the column number of the first element (counting from index `0' of `source') + * @param index starting offset into the array; the first element returned will be `source(index)` + * @param line the line number of the first element (counting from index `0` of `source`) + * @param column the column number of the first element (counting from index `0` of `source`) * * @author Martin Odersky, Adriaan Moors */ diff --git a/src/library/scala/util/parsing/input/OffsetPosition.scala b/src/library/scala/util/parsing/input/OffsetPosition.scala index 864d8972d1..1df1fa050e 100644 --- a/src/library/scala/util/parsing/input/OffsetPosition.scala +++ b/src/library/scala/util/parsing/input/OffsetPosition.scala @@ -45,23 +45,23 @@ case class OffsetPosition(source: java.lang.CharSequence, offset: Int) extends P /** The column number referred to by the position; column numbers start at 1 */ def column: Int = offset - index(line - 1) + 1 - /** The contents of the line numbered `lnum' (must not contain a new-line character). + /** The contents of the line numbered `lnum` (must not contain a new-line character). * - * @param lnum a 1-based integer index into the `document' - * @return the line at `lnum' (not including a newline) + * @param lnum a 1-based integer index into the `document` + * @return the line at `lnum` (not including a newline) */ def lineContents: String = source.subSequence(index(line - 1), index(line)).toString - /** Returns a string representation of the `Position', of the form `line.column' */ + /** Returns a string representation of the `Position`, of the form `line.column` */ override def toString = line+"."+column /** Compare this position to another, by first comparing their line numbers, * and then -- if necessary -- using the columns to break a tie. * - * @param `that' a `Position' to compare to this `Position' - * @return true if this position's line or (in case of a tie wrt. line numbers) - * its column is smaller than the corresponding components of `that' + * @param `that` a `Position` to compare to this `Position` + * @return true if this position's line number or (in case of equal line numbers) + * column is smaller than the corresponding components of `that` */ override def <(that: Position) = that match { case OffsetPosition(_, that_offset) => diff --git a/src/library/scala/util/parsing/input/Position.scala b/src/library/scala/util/parsing/input/Position.scala index bb5180c2c4..b25f03667d 100644 --- a/src/library/scala/util/parsing/input/Position.scala +++ b/src/library/scala/util/parsing/input/Position.scala @@ -15,8 +15,8 @@ package scala.util.parsing.input * <p> * It provides functionality for: * </p><ul> - * <li> generating a visual representation of this position (`longString'); - * <li> comparing two positions (`<'). + * <li> generating a visual representation of this position (`longString`); + * <li> comparing two positions (`<`). * </ul> * <p> * To use this class for a concrete kind of ``document'', implement the @@ -33,14 +33,14 @@ trait Position { /** The column number referred to by the position; column numbers start at 1 */ def column: Int - /** The contents of the line numbered `lnum' (must not contain a new-line character). + /** The contents of the line numbered `lnum` (must not contain a new-line character). * - * @param lnum a 1-based integer index into the `document' - * @return the line at `lnum' (not including a newline) + * @param lnum a 1-based integer index into the `document` + * @return the line at `lnum` (not including a newline) */ protected def lineContents: String - /** Returns a string representation of the `Position', of the form `line.column' */ + /** Returns a string representation of the `Position`, of the form `line.column` */ override def toString = ""+line+"."+column /** Returns a more ``visual'' representation of this position. @@ -58,9 +58,9 @@ trait Position { /** Compare this position to another, by first comparing their line numbers, * and then -- if necessary -- using the columns to break a tie. * - * @param `that' a `Position' to compare to this `Position' - * @return true if this position's line or (in case of a tie wrt. line numbers) - * its column is smaller than the corresponding components of `that' + * @param `that` a `Position` to compare to this `Position` + * @return true if this position's line number or (in case of equal line numbers) + * column is smaller than the corresponding components of `that` */ def <(that: Position) = { this.line < that.line || diff --git a/src/library/scala/util/parsing/input/Positional.scala b/src/library/scala/util/parsing/input/Positional.scala index 5824b5a55e..ff9d81d4e5 100644 --- a/src/library/scala/util/parsing/input/Positional.scala +++ b/src/library/scala/util/parsing/input/Positional.scala @@ -17,7 +17,7 @@ trait Positional { /** The source position of this object, initially set to undefined. */ var pos: Position = NoPosition - /** If current source position is undefined, update it with given position `newpos' + /** If current source position is undefined, update it with given position `newpos` * @return the object itself */ def setPos(newpos: Position): this.type = { diff --git a/src/library/scala/util/parsing/input/StreamReader.scala b/src/library/scala/util/parsing/input/StreamReader.scala index 176e3afb74..1905b3dcdf 100644 --- a/src/library/scala/util/parsing/input/StreamReader.scala +++ b/src/library/scala/util/parsing/input/StreamReader.scala @@ -32,7 +32,7 @@ object StreamReader { * * NOTE: * StreamReaders do not really fulfill the new contract for readers, which - * requires a `source' CharSequence representing the full input. + * requires a `source` CharSequence representing the full input. * Instead source is treated line by line. * As a consequence, regex matching cannot extend beyond a single line * when a StreamReader are used for input. |