summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-03 10:07:48 -0700
committerPaul Phillips <paulp@improving.org>2013-01-30 03:50:40 -0800
commitd2316df920ffa4804fe51e8f8780240c46efa982 (patch)
treeffa35fa116e9367dc38b3539602b885da3f15dc9 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parent05882ebe10f2f72ff5273b198cec02d892b3fc45 (diff)
downloadscala-d2316df920ffa4804fe51e8f8780240c46efa982.tar.gz
scala-d2316df920ffa4804fe51e8f8780240c46efa982.tar.bz2
scala-d2316df920ffa4804fe51e8f8780240c46efa982.zip
SI-6426, importable _.
[backport] Prohibit `_` as an identifier, it can only bring badness.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 33db4ee2d5..c508e14343 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -980,11 +980,8 @@ self =>
/** Assumed (provisionally) to be TermNames. */
def ident(skipIt: Boolean): Name =
- if (isIdent) {
- val name = in.name.encode
- in.nextToken()
- name
- } else {
+ if (isIdent) rawIdent().encode
+ else {
syntaxErrorOrIncomplete(expectedMsg(IDENTIFIER), skipIt)
nme.ERROR
}