diff options
author | Donna Malayeri <lindydonna@gmail.com> | 2010-07-22 09:48:12 +0000 |
---|---|---|
committer | Donna Malayeri <lindydonna@gmail.com> | 2010-07-22 09:48:12 +0000 |
commit | 1e3a43e74ff161da63f7cfe7e413ec412db12a2d (patch) | |
tree | 5394a7edb9219a3c55084dc74e83b738c30e28b5 | |
parent | fdc1be772be617013696f243c7ac5f273f9a39b8 (diff) | |
download | scala-1e3a43e74ff161da63f7cfe7e413ec412db12a2d.tar.gz scala-1e3a43e74ff161da63f7cfe7e413ec412db12a2d.tar.bz2 scala-1e3a43e74ff161da63f7cfe7e413ec412db12a2d.zip |
Revert 22605 change to JavaParsers.scala, which...
Revert 22605 change to JavaParsers.scala, which modified parsing
behavior and broke jvm test t3415. No longer create DocDef nodes for
Javadoc comments in Java source files. No review.
-rw-r--r-- | src/compiler/scala/tools/nsc/javac/JavaParsers.scala | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index db1448c784..0388df7005 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -518,7 +518,6 @@ trait JavaParsers extends JavaScanners { // constructor declaration val vparams = formalParams() optThrows() - in.flushDoc List { atPos(pos) { DefDef(mods, nme.CONSTRUCTOR, tparams, List(vparams), TypeTree(), methodBody()) @@ -534,7 +533,7 @@ trait JavaParsers extends JavaScanners { val vparams = formalParams() if (!isVoid) rtpt = optArrayBrackets(rtpt) optThrows() - lazy val body = // must be lazy so that the next comment is not consumed before joinComment is called + val body = if (!inInterface && in.token == LBRACE) { methodBody() } else { @@ -553,14 +552,14 @@ trait JavaParsers extends JavaScanners { } } if (inInterface) mods1 |= Flags.DEFERRED - joinComment(List { + List { atPos(pos) { DefDef(mods1, name, tparams, List(vparams), rtpt, body) } - }) + } } else { if (inInterface) mods1 |= Flags.FINAL | Flags.STATIC - val result = joinComment(fieldDecls(pos, mods1, rtpt, name)) + val result = fieldDecls(pos, mods1, rtpt, name) accept(SEMI) result } @@ -908,15 +907,5 @@ trait JavaParsers extends JavaScanners { makePackaging(pkg, buf.toList) } } - - /** Combine comment associated with a definition with the definition itself - */ - def joinComment(trees: => List[Tree]): List[Tree] = { - val doc = in.flushDoc - - if ((doc ne null) && doc.raw.length > 0) { - trees map { t => DocDef(doc, t) } - } else trees - } } } |