Skip to content

Commit 8358484

Browse files
committed
Removed commented lines that was not useful anymore
1 parent 4c1d363 commit 8358484

File tree

5 files changed

+14
-30
lines changed

5 files changed

+14
-30
lines changed

tastydoc/src/dotty/tastydoc/TastyExtractor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait TastyExtractor extends TastyTypeConverter with CommentParser with CommentC
4545
comment match {
4646
case Some(com) =>
4747
(packages, userDocSyntax) => {
48-
val parsed = parse(packages, clean(com.raw), com.raw)
48+
val parsed = parse(rep, packages, clean(com.raw), com.raw)
4949
if (userDocSyntax == "markdown") {
5050
Some(MarkdownComment(rep, parsed, packages).comment)
5151
}else if(userDocSyntax == "wiki"){

tastydoc/src/dotty/tastydoc/comment/CommentParser.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ trait CommentParser {
1717
* @param span the position of the comment in source.
1818
*/
1919
def parse(
20-
//representation: Representation,
20+
representation: Representation,
2121
packages: Map[String, EmulatedPackageRepresentation],
2222
comment: List[String],
23-
src: String,
24-
// span: Span,
25-
// site: Symbol = NoSymbol
23+
src: String
2624
): ParsedComment = {
2725

2826
/** Parses a comment (in the form of a list of lines) to a `Comment`

tastydoc/src/dotty/tastydoc/comment/WikiParser.scala

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import Regexes._
1515
private[comment] final class WikiParser(
1616
representation: Representation,
1717
packages: Map[String, EmulatedPackageRepresentation],
18-
val buffer: String,
19-
// span: Span,
20-
// site: Symbol
18+
val buffer: String
2119
) extends CharReader(buffer) with MemberLookup { wiki =>
2220
var summaryParsed = false
2321

@@ -104,9 +102,9 @@ private[comment] final class WikiParser(
104102
jumpWhitespace()
105103
jump("{{{")
106104
val str = readUntil("}}}")
107-
// if (char == endOfText)
108-
// reportError(span, "unclosed code block")
109-
// else
105+
if (char == endOfText)
106+
reportError("unclosed code block")
107+
else
110108
jump("}}}")
111109
blockEnded("code block")
112110
Code(normalizeIndentation(str))
@@ -118,8 +116,8 @@ private[comment] final class WikiParser(
118116
val inLevel = repeatJump('=')
119117
val text = getInline(check("=" * inLevel))
120118
val outLevel = repeatJump('=', inLevel)
121-
// if (inLevel != outLevel)
122-
// reportError(span, "unbalanced or unclosed heading")
119+
if (inLevel != outLevel)
120+
reportError("unbalanced or unclosed heading")
123121
blockEnded("heading")
124122
Title(text, inLevel)
125123
}
@@ -339,7 +337,7 @@ private[comment] final class WikiParser(
339337
/** {{{ eol ::= { whitespace } '\n' }}} */
340338
def blockEnded(blockType: String): Unit = {
341339
if (char != endOfLine && char != endOfText) {
342-
//reportError(span, "no additional content on same line after " + blockType)
340+
reportError("no additional content on same line after " + blockType)
343341
jumpUntil(endOfLine)
344342
}
345343
while (char == endOfLine)
@@ -397,8 +395,7 @@ private[comment] final class WikiParser(
397395
}
398396
}
399397

400-
// def reportError(span: Span, message: String) =
401-
// dottydoc.println(s"$span: $message")
398+
def reportError(message: String) = println(s"$message")
402399
}
403400

404401
sealed class CharReader(buffer: String) { reader =>

tastydoc/src/dotty/tastydoc/representations.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ object representations extends TastyExtractor {
1111
trait Representation {
1212
val name : String
1313
val path : List[String]
14-
//def comments(packages: Map[String, EmulatedPackageRepresentation]): Option[Comment]
1514
def comments(packages: Map[String, EmulatedPackageRepresentation], userDocSyntax: String): Option[Comment]
1615
val parentRepresentation: Option[Representation] //Called simply "parent" in dotty-doc
1716
val annotations: List[TypeReference]
@@ -62,7 +61,9 @@ object representations extends TastyExtractor {
6261
val typeParams: List[String]
6362
}
6463

65-
class EmulatedPackageRepresentation(val name: String, val path: List[String]) given (mutablePackagesMap: scala.collection.mutable.HashMap[String, EmulatedPackageRepresentation]) extends Representation with Members { //This contains all the packages representing a single package
64+
/** This contains all the PackageRepresentation representing a single package
65+
*/
66+
class EmulatedPackageRepresentation(val name: String, val path: List[String]) given (mutablePackagesMap: scala.collection.mutable.HashMap[String, EmulatedPackageRepresentation]) extends Representation with Members {
6667
override val parentRepresentation = None
6768
override val annotations = Nil
6869
override def comments(packages: Map[String, EmulatedPackageRepresentation], userDocSyntax: String) = None

tastydoc/test/dotty/tastydoc/Tests.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ class Tests {
3636
"example.UserDocLinkingClass"
3737
))
3838
}
39-
@Test def testListFromLib(): Unit = {
40-
Main.main(Array(
41-
"--classpath",
42-
"tastydoc/out/bootstrap/dotty-tastydoc-input/scala-0.16/classes",
43-
"--syntax",
44-
"wiki",
45-
"--packagestolink",
46-
"scala.*",
47-
"-i",
48-
"scala.collection.immutable.List"
49-
))
50-
}
5139
@Test def testDotty(): Unit = {
5240
Main.main(Array(
5341
"--classpath",

0 commit comments

Comments
 (0)