Skip to content

Commit

Permalink
Merge pull request #143 from jendrikw/feature/charseqreader.tostring
Browse files Browse the repository at this point in the history
Added CharSequenceReader.toString
  • Loading branch information
gourlaysama authored May 18, 2018
2 parents 25139f0 + fe57b90 commit 8e8e880
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,12 @@ class CharSequenceReader(override val source: java.lang.CharSequence,
*/
override def drop(n: Int): CharSequenceReader =
new CharSequenceReader(source, offset + n)

/** Returns a String in the form `CharSequenceReader(first, ...)`,
* or `CharSequenceReader()` if this is `atEnd`.
*/
override def toString: String = {
val c = if (atEnd) "" else s"'$first', ..."
s"CharSequenceReader($c)"
}
}

0 comments on commit 8e8e880

Please sign in to comment.