summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-08 00:02:22 +0000
committerPaul Phillips <paulp@improving.org>2010-12-08 00:02:22 +0000
commitcbc8495920e1db752cdb2da9c1446395bdb800ff (patch)
treec72b806331b69f471028b3d3e159a539bf0a30a6 /src
parentc4daaeae6c0e7bcd7eb34f47df70eb6388991103 (diff)
downloadscala-cbc8495920e1db752cdb2da9c1446395bdb800ff.tar.gz
scala-cbc8495920e1db752cdb2da9c1446395bdb800ff.tar.bz2
scala-cbc8495920e1db752cdb2da9c1446395bdb800ff.zip
The lords of attrition informed me that "isType...
The lords of attrition informed me that "isTypeApply" is passed all over the parser but nobody ever eats the hot potato. I put the potato on ice. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index 2eb6b8c5f4..aa7f0eefca 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -691,7 +691,7 @@ self =>
/** Assumed (provisionally) to be TermNames. */
def ident(skipIt: Boolean): Name =
- if (in.token == IDENTIFIER || in.token == BACKQUOTED_IDENT) {
+ if (isIdent) {
val name = in.name.encode
in.nextToken()
name
@@ -854,8 +854,8 @@ self =>
/** Types ::= Type {`,' Type}
*/
- def types(isPattern: Boolean, isTypeApply: Boolean, isFuncArg: Boolean): List[Tree] =
- commaSeparated(argType(isPattern, isTypeApply, isFuncArg))
+ def types(isPattern: Boolean, isFuncArg: Boolean): List[Tree] =
+ commaSeparated(argType(isPattern, isFuncArg))
/** Type ::= InfixType `=>' Type
* | `(' [`=>' Type] `)' `=>' Type
@@ -876,7 +876,7 @@ self =>
makeFunctionTypeTree(List(), typ(isPattern))
}
} else {
- val ts = types(isPattern, false, true)
+ val ts = types(isPattern, true)
accept(RPAREN)
if (in.token == ARROW)
atPos(start, in.skipToken()) {
@@ -987,7 +987,7 @@ self =>
val t =
if (in.token == LPAREN) {
in.nextToken()
- val ts = types(isPattern, false, false)
+ val ts = types(isPattern, false)
accept(RPAREN)
atPos(start) { makeTupleType(ts, true) }
} else if (in.token == USCORE) {
@@ -1009,7 +1009,7 @@ self =>
}
simpleTypeRest(sel, isPattern)
} else if (in.token == LBRACKET) {
- simpleTypeRest(atPos(t.pos.startOrPoint) { AppliedTypeTree(t, typeArgs(isPattern, false)) }, isPattern)
+ simpleTypeRest(atPos(t.pos.startOrPoint) { AppliedTypeTree(t, typeArgs(isPattern)) }, isPattern)
} else {
t
}
@@ -1027,16 +1027,16 @@ self =>
/** TypeArgs ::= `[' ArgType {`,' ArgType} `]'
*/
- def typeArgs(isPattern: Boolean, isTypeApply: Boolean): List[Tree] = {
+ def typeArgs(isPattern: Boolean): List[Tree] = {
accept(LBRACKET)
- val ts = types(isPattern, isTypeApply, false)
+ val ts = types(isPattern, false)
accept(RBRACKET)
ts
}
/** ArgType ::= Type
*/
- def argType(isPattern: Boolean, isTypeApply: Boolean, isFuncArg: Boolean): Tree = {
+ def argType(isPattern: Boolean, isFuncArg: Boolean): Tree = {
val start = in.offset
if (isPattern) {
if (in.token == USCORE) {
@@ -1401,7 +1401,7 @@ self =>
t1 match {
case Ident(_) | Select(_, _) =>
val tapp = atPos(t1.pos.startOrPoint, in.offset) {
- TypeApply(t1, typeArgs(false, true))
+ TypeApply(t1, typeArgs(false))
}
simpleExprRest(tapp, true)
case _ =>
@@ -1655,7 +1655,7 @@ self =>
case _ =>
}
val typeAppliedTree = in.token match {
- case LBRACKET => atPos(start, in.offset)(TypeApply(convertToTypeId(t), typeArgs(true, false)))
+ case LBRACKET => atPos(start, in.offset)(TypeApply(convertToTypeId(t), typeArgs(true)))
case _ => t
}
in.token match {