diff options
author | Martin Odersky <odersky@gmail.com> | 2012-04-13 15:46:02 -0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-04-13 15:46:02 -0700 |
commit | 7f2624e2ee57d10ff39452164899937dc799e8b1 (patch) | |
tree | e08e50b26bcad0d8ed1e29f51ab4c9bfc9837fe1 | |
parent | cc764e944817628cbca3f7b5a195cdb495ca8f38 (diff) | |
download | scala-7f2624e2ee57d10ff39452164899937dc799e8b1.tar.gz scala-7f2624e2ee57d10ff39452164899937dc799e8b1.tar.bz2 scala-7f2624e2ee57d10ff39452164899937dc799e8b1.zip |
Fixed problems with new deprecated idents scheme.
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 105db805d8..583da36ead 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -115,17 +115,16 @@ trait Scanners extends ScannersCommon { /** Clear buffer and set name and token */ private def finishNamed(idtoken: Int = IDENTIFIER) { name = newTermName(cbuf.toString) + cbuf.clear() token = idtoken - val idx = name.start - kwOffset - if (idx >= 0 && idx < kwArray.length) { - token = kwArray(idx) - if (token == IDENTIFIER) { - if (idtoken == IDENTIFIER && allowIdent != name) + if (idtoken == IDENTIFIER) { + val idx = name.start - kwOffset + if (idx >= 0 && idx < kwArray.length) { + token = kwArray(idx) + if (token == IDENTIFIER && allowIdent != name) deprecationWarning(name+" is now a reserved word; usage as an identifier is deprecated") - token = idtoken } } - cbuf.clear() } /** Clear buffer and set string */ |