From 7f2624e2ee57d10ff39452164899937dc799e8b1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 13 Apr 2012 15:46:02 -0700 Subject: Fixed problems with new deprecated idents scheme. --- src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/compiler') 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 */ -- cgit v1.2.3