diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-03 10:07:48 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-30 03:50:40 -0800 |
commit | d2316df920ffa4804fe51e8f8780240c46efa982 (patch) | |
tree | ffa35fa116e9367dc38b3539602b885da3f15dc9 /src/compiler | |
parent | 05882ebe10f2f72ff5273b198cec02d892b3fc45 (diff) | |
download | scala-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')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 7 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 5 |
2 files changed, 6 insertions, 6 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 } diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 4f564c5d0b..45df318e40 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -607,7 +607,10 @@ trait Scanners extends ScannersCommon { if (ch == '`') { nextChar() finishNamed(BACKQUOTED_IDENT) - if (name.length == 0) syntaxError("empty quoted identifier") + if (name.length == 0) + syntaxError("empty quoted identifier") + else if (name == nme.WILDCARD) + syntaxError("wildcard invalid as backquoted identifier") } else syntaxError("unclosed quoted identifier") } |