summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-07-30 21:04:43 +0000
committerMartin Odersky <odersky@gmail.com>2011-07-30 21:04:43 +0000
commitc0db3f2d065e22796a2c917c6c3b0f14f3982cf0 (patch)
treea21a5982ec9d0a6311843b2e1397192a3a64aecd /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
parentd0c5e4be5554f4862da0690ac0315a4433fcb5d5 (diff)
downloadscala-c0db3f2d065e22796a2c917c6c3b0f14f3982cf0.tar.gz
scala-c0db3f2d065e22796a2c917c6c3b0f14f3982cf0.tar.bz2
scala-c0db3f2d065e22796a2c917c6c3b0f14f3982cf0.zip
LiftCode works again, now integrated with new r...
LiftCode works again, now integrated with new reflection library. Other changes: def Literal(x: Any) has been deprecated, and all its uses removed. Modifiers has lost positions as fourth case class argument; is now a field, mirroring Tree.pos (this removes junk in patterns and makes reification simpler). Review by extempore.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/parser/Parsers.scala16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
index ac9f853477..6b9f7bf79e 100644
--- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
@@ -51,7 +51,7 @@ trait ParsersCommon extends ScannersCommon {
def inParensOrError[T](body: => T, alt: T): T =
if (in.token == LPAREN) inParens(body)
else { accept(LPAREN) ; alt }
- def inParensOrUnit[T](body: => Tree): Tree = inParensOrError(body, Literal(()))
+ def inParensOrUnit[T](body: => Tree): Tree = inParensOrError(body, Literal(Constant()))
def inParensOrNil[T](body: => List[T]): List[T] = inParensOrError(body, Nil)
def inBraces[T](body: => T): T = {
@@ -64,7 +64,7 @@ trait ParsersCommon extends ScannersCommon {
if (in.token == LBRACE) inBraces(body)
else { accept(LBRACE) ; alt }
def inBracesOrNil[T](body: => List[T]): List[T] = inBracesOrError(body, Nil)
- def inBracesOrUnit[T](body: => Tree): Tree = inBracesOrError(body, Literal(()))
+ def inBracesOrUnit[T](body: => Tree): Tree = inBracesOrError(body, Literal(Constant()))
def inBrackets[T](body: => T): T = {
accept(LBRACKET)
@@ -1197,7 +1197,7 @@ self =>
r
} else {
accept(LPAREN)
- Literal(true)
+ Literal(Constant(true))
}
}
@@ -1250,7 +1250,7 @@ self =>
newLinesOpt()
val thenp = expr()
val elsep = if (in.token == ELSE) { in.nextToken(); expr() }
- else Literal(())
+ else Literal(Constant())
If(cond, thenp, elsep)
}
case TRY =>
@@ -1311,7 +1311,7 @@ self =>
}
case RETURN =>
atPos(in.skipToken()) {
- Return(if (isExprIntro) expr() else Literal(()))
+ Return(if (isExprIntro) expr() else Literal(Constant()))
}
case THROW =>
atPos(in.skipToken()) {
@@ -2431,7 +2431,7 @@ self =>
*/
def constrExpr(vparamss: List[List[ValDef]]): Tree =
if (in.token == LBRACE) constrBlock(vparamss)
- else Block(List(selfInvocation(vparamss)), Literal(()))
+ else Block(List(selfInvocation(vparamss)), Literal(Constant()))
/** {{{
* SelfInvocation ::= this ArgumentExprs {ArgumentExprs}
@@ -2461,7 +2461,7 @@ self =>
else Nil
}
accept(RBRACE)
- Block(stats, Literal(()))
+ Block(stats, Literal(Constant()))
}
/** {{{
@@ -2902,7 +2902,7 @@ self =>
else List(tmplDef(pos, mods))
in.token match {
- case RBRACE | CASE => defs :+ (Literal(()) setPos o2p(in.offset))
+ case RBRACE | CASE => defs :+ (Literal(Constant()) setPos o2p(in.offset))
case _ => defs
}
}