summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2008-08-06 12:47:23 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2008-08-06 12:47:23 +0000
commit51f09101bb08a0d4e52ec4adb43bd72105e07e3d (patch)
tree6532af5ca3f706ca8bdb2a5b629e6aa5330be3af /src
parentf07ac82ac24574719db524add05d46e30b3f1502 (diff)
downloadscala-51f09101bb08a0d4e52ec4adb43bd72105e07e3d.tar.gz
scala-51f09101bb08a0d4e52ec4adb43bd72105e07e3d.tar.bz2
scala-51f09101bb08a0d4e52ec4adb43bd72105e07e3d.zip
Blind patch for bug reported on mailing list.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/util/NameTransformer.scala42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/compiler/scala/tools/nsc/util/NameTransformer.scala b/src/compiler/scala/tools/nsc/util/NameTransformer.scala
index eb8a88f87b..855b2d563d 100644
--- a/src/compiler/scala/tools/nsc/util/NameTransformer.scala
+++ b/src/compiler/scala/tools/nsc/util/NameTransformer.scala
@@ -107,29 +107,29 @@ object NameTransformer {
buf.append(ops.op)
i += ops.code.length()
}
- /* Handle the decoding of Unicode glyphs that are
- not valid Java/JVM identifiers */
+ /* Handle the decoding of Unicode glyphs that are
+ * not valid Java/JVM identifiers */
} else if (ch1 == 'u' &&
- (Character.isDigit(ch2)) ||
- ('A' <= ch2 && ch2 <= 'F')) {
- /* Skip past "$u", next four should be hexadecimal */
- val hex = name.substring(i+2, i+6)
- try {
- val str = Integer.parseInt(hex, 16).toChar
- if (buf eq null) {
- buf = new StringBuilder()
- buf.append(name.substring(0, i))
- }
- buf.append(str)
- /* 2 for "$u", 4 for hexadecimal number */
- i += 6
- unicode = true
- } catch {
- case _:NumberFormatException =>
- /* <code>hex</code> did not decode to a hexadecimal number, so
- do nothing. */
+ (Character.isDigit(ch2)) ||
+ ('A' <= ch2 && ch2 <= 'F')) {
+ /* Skip past "$u", next four should be hexadecimal */
+ val hex = name.substring(i+2, if (i+6 <= len) i+6 else len)
+ try {
+ val str = Integer.parseInt(hex, 16).toChar
+ if (buf eq null) {
+ buf = new StringBuilder()
+ buf.append(name.substring(0, i))
}
- }
+ buf.append(str)
+ /* 2 for "$u", 4 for hexadecimal number */
+ i += 6
+ unicode = true
+ } catch {
+ case _:NumberFormatException =>
+ /* <code>hex</code> did not decode to a hexadecimal number, so
+ * do nothing. */
+ }
+ }
}
}
/* If we didn't see an opcode or encoded Unicode glyph, and the