summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVisitor <som.snytt@gmail.com>2013-12-31 23:59:16 -0500
committerSom Snytt <som.snytt@gmail.com>2014-01-08 07:43:42 -0800
commit2c8a8ff6ba29be8d21845c272157ded07acc67d8 (patch)
tree220366860347c9b6fa4e1ff125cbf02257757114
parent8be560a1cf6306ea4ed2596f3b6631c2e44d8213 (diff)
downloadscala-2c8a8ff6ba29be8d21845c272157ded07acc67d8.tar.gz
scala-2c8a8ff6ba29be8d21845c272157ded07acc67d8.tar.bz2
scala-2c8a8ff6ba29be8d21845c272157ded07acc67d8.zip
SI-8015 Carat => Caret
Just a diamond in the rough. Wikipedia warns against confusing it with "carrot." The first word should really be pronounced as the garage phrase, "Where's the car at?" and the second like "beret."
-rw-r--r--src/reflect/scala/reflect/internal/util/Position.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/reflect/scala/reflect/internal/util/Position.scala b/src/reflect/scala/reflect/internal/util/Position.scala
index dbee31bfca..bcf637b558 100644
--- a/src/reflect/scala/reflect/internal/util/Position.scala
+++ b/src/reflect/scala/reflect/internal/util/Position.scala
@@ -202,12 +202,14 @@ private[util] trait InternalPositionImpl {
def line: Int = if (hasSource) source.offsetToLine(point) + 1 else 0
def column: Int = if (hasSource) calculateColumn() else 0
def lineContent: String = if (hasSource) source.lineToString(line - 1) else ""
- def lineCarat: String = if (hasSource) " " * (column - 1) + "^" else ""
+ def lineCaret: String = if (hasSource) " " * (column - 1) + "^" else ""
+ @deprecated("use `lineCaret`", since="2.11.0")
+ def lineCarat: String = lineCaret
def showError(msg: String): String = finalPosition match {
case FakePos(fmsg) => s"$fmsg $msg"
case NoPosition => msg
- case pos => f"${pos.line}: $msg%n${u(pos.lineContent)}%n${pos.lineCarat}"
+ case pos => f"${pos.line}: $msg%n${u(pos.lineContent)}%n${pos.lineCaret}"
}
private def u(s: String) = {
def uu(c: Int) = f"\\u$c%04x"
@@ -263,7 +265,7 @@ private[util] trait DeprecatedPosition {
@deprecated("use `finalPosition`", "2.11.0")
def inUltimateSource(source: SourceFile): Position = source positionInUltimateSource this
- @deprecated("use `lineCarat`", "2.11.0")
+ @deprecated("use `lineCaret`", since="2.11.0")
def lineWithCarat(maxWidth: Int): (String, String) = ("", "")
@deprecated("Use `withSource(source)` and `withShift`", "2.11.0")