aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/util/SourceFile.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-24 23:50:34 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-02-25 00:31:18 +0100
commit94b41d5c491878543288af1bedb4daf57226ca07 (patch)
tree0a2b6a019415ea3ce35b2eb826161c5aa41c6973 /src/dotty/tools/dotc/util/SourceFile.scala
parent0eecb7189188e6ce379b8840749abb1e0241035b (diff)
downloaddotty-94b41d5c491878543288af1bedb4daf57226ca07.tar.gz
dotty-94b41d5c491878543288af1bedb4daf57226ca07.tar.bz2
dotty-94b41d5c491878543288af1bedb4daf57226ca07.zip
Small API changes in preparation for dotty-interfaces
- Rename Diagnostic#msg to message, this is nicer for a public API - Rename SourceFile#lineContents and SourcePosition#lineContents to lineContent, the former is not grammatically correct. - Add some convenience methods to SourcePosition.
Diffstat (limited to 'src/dotty/tools/dotc/util/SourceFile.scala')
-rw-r--r--src/dotty/tools/dotc/util/SourceFile.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/util/SourceFile.scala b/src/dotty/tools/dotc/util/SourceFile.scala
index da2e54132..ac3ee298e 100644
--- a/src/dotty/tools/dotc/util/SourceFile.scala
+++ b/src/dotty/tools/dotc/util/SourceFile.scala
@@ -113,8 +113,8 @@ case class SourceFile(file: AbstractFile, content: Array[Char]) {
def nextLine(offset: Int): Int =
lineToOffset(offsetToLine(offset) + 1 min lineIndices.length - 1)
- /** The contents of the line containing position `offset` */
- def lineContents(offset: Int): String =
+ /** The content of the line containing position `offset` */
+ def lineContent(offset: Int): String =
content.slice(startOfLine(offset), nextLine(offset)).mkString
/** The column corresponding to `offset`, starting at 0 */