@@ -97,26 +97,26 @@ trait CommentFactoryBase { this: MemberLookupBase =>
9797
9898 }
9999
100- protected val endOfText = '\u0003 '
101- protected val endOfLine = '\u000A '
100+ private val endOfText = '\u0003 '
101+ private val endOfLine = '\u000A '
102102
103103 /** Something that should not have happened, happened, and Scaladoc should exit. */
104- protected def oops (msg : String ): Nothing =
104+ private def oops (msg : String ): Nothing =
105105 throw FatalError (" program logic: " + msg)
106106
107107 /** The body of a line, dropping the (optional) start star-marker,
108108 * one leading whitespace and all trailing whitespace. */
109- protected val CleanCommentLine =
109+ private val CleanCommentLine =
110110 new Regex (""" (?:\s*\*\s?)?(.*)""" )
111111
112112 /** Dangerous HTML tags that should be replaced by something safer,
113113 * such as wiki syntax, or that should be dropped. */
114- protected val DangerousTags =
114+ private val DangerousTags =
115115 new Regex (""" <(/?(div|ol|ul|li|h[1-6]|p))( [^>]*)?/?>|<!--.*-->""" )
116116
117117 /** Maps a dangerous HTML tag to a safe wiki replacement, or an empty string
118118 * if it cannot be salvaged. */
119- protected def htmlReplacement (mtch : Regex .Match ): String = mtch.group(1 ) match {
119+ private def htmlReplacement (mtch : Regex .Match ): String = mtch.group(1 ) match {
120120 case " p" | " div" => " \n\n "
121121 case " h1" => " \n = "
122122 case " /h1" => " =\n "
@@ -132,11 +132,11 @@ trait CommentFactoryBase { this: MemberLookupBase =>
132132
133133 /** Javadoc tags that should be replaced by something useful, such as wiki
134134 * syntax, or that should be dropped. */
135- protected val JavadocTags =
135+ private val JavadocTags =
136136 new Regex (""" \{\@(code|docRoot|inheritDoc|link|linkplain|literal|value)([^}]*)\}""" )
137137
138138 /** Maps a javadoc tag to a useful wiki replacement, or an empty string if it cannot be salvaged. */
139- protected def javadocReplacement (mtch : Regex .Match ): String = mtch.group(1 ) match {
139+ private def javadocReplacement (mtch : Regex .Match ): String = mtch.group(1 ) match {
140140 case " code" => " `" + mtch.group(2 ) + " `"
141141 case " docRoot" => " "
142142 case " inheritDoc" => " "
@@ -148,41 +148,41 @@ trait CommentFactoryBase { this: MemberLookupBase =>
148148 }
149149
150150 /** Safe HTML tags that can be kept. */
151- protected val SafeTags =
151+ private val SafeTags =
152152 new Regex (""" ((&\w+;)|(&#\d+;)|(</?(abbr|acronym|address|area|a|bdo|big|blockquote|br|button|b|caption|cite|code|col|colgroup|dd|del|dfn|em|fieldset|form|hr|img|input|ins|i|kbd|label|legend|link|map|object|optgroup|option|param|pre|q|samp|select|small|span|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|tr|tt|var)( [^>]*)?/?>))""" )
153153
154- protected val safeTagMarker = '\u000E '
154+ private val safeTagMarker = '\u000E '
155155
156156 /** A Scaladoc tag not linked to a symbol and not followed by text */
157- protected val SingleTag =
157+ private val SingleTagRegex =
158158 new Regex (""" \s*@(\S+)\s*""" )
159159
160160 /** A Scaladoc tag not linked to a symbol. Returns the name of the tag, and the rest of the line. */
161- protected val SimpleTag =
161+ private val SimpleTagRegex =
162162 new Regex (""" \s*@(\S+)\s+(.*)""" )
163163
164164 /** A Scaladoc tag linked to a symbol. Returns the name of the tag, the name
165165 * of the symbol, and the rest of the line. */
166- protected val SymbolTag =
166+ private val SymbolTagRegex =
167167 new Regex (""" \s*@(param|tparam|throws|groupdesc|groupname|groupprio)\s+(\S*)\s*(.*)""" )
168168
169169 /** The start of a scaladoc code block */
170- protected val CodeBlockStart =
170+ private val CodeBlockStartRegex =
171171 new Regex (""" (.*?)((?:\{\{\{)|(?:\u000E <pre(?: [^>]*)?>\u000E ))(.*)""" )
172172
173173 /** The end of a scaladoc code block */
174- protected val CodeBlockEnd =
174+ private val CodeBlockEndRegex =
175175 new Regex (""" (.*?)((?:\}\}\})|(?:\u000E </pre>\u000E ))(.*)""" )
176176
177177 /** A key used for a tag map. The key is built from the name of the tag and
178178 * from the linked symbol if the tag has one.
179179 * Equality on tag keys is structural. */
180- protected sealed abstract class TagKey {
180+ private sealed abstract class TagKey {
181181 def name : String
182182 }
183183
184- protected final case class SimpleTagKey (name : String ) extends TagKey
185- protected final case class SymbolTagKey (name : String , symbol : String ) extends TagKey
184+ private final case class SimpleTagKey (name : String ) extends TagKey
185+ private final case class SymbolTagKey (name : String , symbol : String ) extends TagKey
186186
187187 /** Parses a raw comment string into a `Comment` object.
188188 * @param comment The expanded comment string (including start and end markers) to be parsed.
@@ -228,7 +228,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
228228 inCodeBlock : Boolean
229229 ): Comment = remaining match {
230230
231- case CodeBlockStart (before, marker, after) :: ls if (! inCodeBlock) =>
231+ case CodeBlockStartRegex (before, marker, after) :: ls if (! inCodeBlock) =>
232232 if (! before.trim.isEmpty && ! after.trim.isEmpty)
233233 parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, false )
234234 else if (! before.trim.isEmpty)
@@ -247,7 +247,7 @@ trait CommentFactoryBase { this: MemberLookupBase =>
247247 parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, true )
248248 }
249249
250- case CodeBlockEnd (before, marker, after) :: ls =>
250+ case CodeBlockEndRegex (before, marker, after) :: ls =>
251251 if (! before.trim.isEmpty && ! after.trim.isEmpty)
252252 parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, true )
253253 if (! before.trim.isEmpty)
@@ -266,17 +266,17 @@ trait CommentFactoryBase { this: MemberLookupBase =>
266266 parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, false )
267267 }
268268
269- case SymbolTag (name, sym, body) :: ls if (! inCodeBlock) =>
269+ case SymbolTagRegex (name, sym, body) :: ls if (! inCodeBlock) =>
270270 val key = SymbolTagKey (name, sym)
271271 val value = body :: tags.getOrElse(key, Nil )
272272 parse0(docBody, tags + (key -> value), Some (key), ls, inCodeBlock)
273273
274- case SimpleTag (name, body) :: ls if (! inCodeBlock) =>
274+ case SimpleTagRegex (name, body) :: ls if (! inCodeBlock) =>
275275 val key = SimpleTagKey (name)
276276 val value = body :: tags.getOrElse(key, Nil )
277277 parse0(docBody, tags + (key -> value), Some (key), ls, inCodeBlock)
278278
279- case SingleTag (name) :: ls if (! inCodeBlock) =>
279+ case SingleTagRegex (name) :: ls if (! inCodeBlock) =>
280280 val key = SimpleTagKey (name)
281281 val value = " " :: tags.getOrElse(key, Nil )
282282 parse0(docBody, tags + (key -> value), Some (key), ls, inCodeBlock)
0 commit comments