aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-06-04 18:00:37 +0200
committerMartin Odersky <odersky@gmail.com>2013-06-04 18:00:37 +0200
commitb28c9ef75e274bdc54e9502e56c95b505495de5b (patch)
tree84b350bffb77d521d7c8393096b43deca78f5e5f /src/dotty/tools/dotc/printing
parent4fc1d8501a3937547e05f14aa4f4423a2c0d6a1d (diff)
downloaddotty-b28c9ef75e274bdc54e9502e56c95b505495de5b.tar.gz
dotty-b28c9ef75e274bdc54e9502e56c95b505495de5b.tar.bz2
dotty-b28c9ef75e274bdc54e9502e56c95b505495de5b.zip
Refactoring: breaking out desugaring into its own object.
Also, changing the maps in Namer. More commenting needs to be done. Pushing now to get off this machine and back to the new one, which just came back form repair.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r--src/dotty/tools/dotc/printing/RefinedPrinter.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
index 9a3baa03f..23482b773 100644
--- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala
+++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
@@ -222,13 +222,14 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
}
modText(mods, "type") ~~ toText(name) ~ tparamsText(tparams) ~ rhsText
}
- case Template(DefDef(mods, _, _, vparamss, _, _), parents, self, stats) =>
+ case Template(DefDef(mods, _, tparams, vparamss, _, _), parents, self, stats) =>
+ val tparamsTxt = tparamsText(tparams)
val prefix: Text =
- if (vparamss.isEmpty) ""
+ if (vparamss.isEmpty) tparamsTxt
else {
var modsText = modText(mods, "")
if (mods.hasAnnotations && !mods.hasFlags) modsText = modsText ~~ " this"
- addVparamssText(modsText, vparamss)
+ addVparamssText(tparamsTxt ~~ modsText, vparamss)
}
val parentsText = Text(parents map constrText, " with ")
val selfText = {
@@ -237,10 +238,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
} provided !self.isEmpty
val bodyText = "{" ~~ selfText ~~ toTextGlobal(stats, "\n") ~ "}"
prefix ~~ (" extends" provided ownerIsClass) ~~ parentsText ~~ bodyText
- case ClassDef(mods, name, tparams, impl) =>
+ case ClassDef(mods, name, impl) =>
atOwner(tree) {
- modText(mods, if (mods is Trait) "trait" else "class") ~~
- toText(name) ~ tparamsText(tparams) ~ toText(impl)
+ modText(mods, if (mods is Trait) "trait" else "class") ~~ toText(name) ~ toText(impl)
}
case Import(expr, selectors) =>
def selectorText(sel: Tree): Text = sel match {