summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-07-13 19:24:31 +0000
committerLex Spoon <lex@lexspoon.org>2007-07-13 19:24:31 +0000
commitf6a91763080edaf39e94983f1da7156139b6b491 (patch)
treecd01fa1dfd71e0cf58c0e121f520f20a7611ef93
parent72105be047b775ad0c3080cb31dd43e392b6ce2b (diff)
downloadscala-f6a91763080edaf39e94983f1da7156139b6b491.tar.gz
scala-f6a91763080edaf39e94983f1da7156139b6b491.tar.bz2
scala-f6a91763080edaf39e94983f1da7156139b6b491.zip
make extra sure that ch==SU whenever the
end of the buffer is reached
-rw-r--r--src/compiler/scala/tools/nsc/util/CharArrayReader.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
index 7cd72be464..ba67c6e3ea 100644
--- a/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
+++ b/src/compiler/scala/tools/nsc/util/CharArrayReader.scala
@@ -53,8 +53,11 @@ class CharArrayReader(buf: Array[Char], start: Int, /* startline: Int, startcol:
def next: Char = {
//cline = nextline
//ccol = nextcol
- if(!hasNext)
- return SU // there is an endless stream of SU's at the end
+ if(!hasNext) {
+ // there is an endless stream of SU's at the end
+ ch = SU
+ return SU
+ }
oldBp = bp
oldCh = ch
ch = buf(bp)