diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-24 14:44:57 +0100 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-05 09:39:30 -0800 |
commit | fff0f50773b45690d571852b139bd6da7b6a45ae (patch) | |
tree | 9f53db9730fe2d07167e817d0692c3f53f483275 /src/compiler/scala/tools/nsc/doc | |
parent | c4341385629bd114b61c55103f1d83f26dce22f9 (diff) | |
download | scala-fff0f50773b45690d571852b139bd6da7b6a45ae.tar.gz scala-fff0f50773b45690d571852b139bd6da7b6a45ae.tar.bz2 scala-fff0f50773b45690d571852b139bd6da7b6a45ae.zip |
Name boolean arguments in src/compiler.
What would you prefer?
adaptToMemberWithArgs(tree, qual, name, mode, false, false)
Or:
adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc')
8 files changed, 49 insertions, 49 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/DocFactory.scala b/src/compiler/scala/tools/nsc/doc/DocFactory.scala index f203a5eeb7..b4d2adaad4 100644 --- a/src/compiler/scala/tools/nsc/doc/DocFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/DocFactory.scala @@ -94,7 +94,7 @@ class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor val documentError: PartialFunction[Throwable, Unit] = { case NoCompilerRunException => - reporter.info(null, "No documentation generated with unsucessful compiler run", false) + reporter.info(null, "No documentation generated with unsucessful compiler run", force = false) case _: ClassNotFoundException => () } diff --git a/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala b/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala index a308292811..2064d86860 100755 --- a/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala +++ b/src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala @@ -228,11 +228,11 @@ trait CommentFactoryBase { this: MemberLookupBase => case CodeBlockStartRegex(before, marker, after) :: ls if (!inCodeBlock) => if (!before.trim.isEmpty && !after.trim.isEmpty) - parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, false) + parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = false) else if (!before.trim.isEmpty) - parse0(docBody, tags, lastTagKey, before :: marker :: ls, false) + parse0(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = false) else if (!after.trim.isEmpty) - parse0(docBody, tags, lastTagKey, marker :: after :: ls, true) + parse0(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = true) else lastTagKey match { case Some(key) => val value = @@ -240,18 +240,18 @@ trait CommentFactoryBase { this: MemberLookupBase => case Some(b :: bs) => (b + endOfLine + marker) :: bs case None => oops("lastTagKey set when no tag exists for key") } - parse0(docBody, tags + (key -> value), lastTagKey, ls, true) + parse0(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = true) case None => - parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, true) + parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = true) } case CodeBlockEndRegex(before, marker, after) :: ls => if (!before.trim.isEmpty && !after.trim.isEmpty) - parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, true) + parse0(docBody, tags, lastTagKey, before :: marker :: after :: ls, inCodeBlock = true) if (!before.trim.isEmpty) - parse0(docBody, tags, lastTagKey, before :: marker :: ls, true) + parse0(docBody, tags, lastTagKey, before :: marker :: ls, inCodeBlock = true) else if (!after.trim.isEmpty) - parse0(docBody, tags, lastTagKey, marker :: after :: ls, false) + parse0(docBody, tags, lastTagKey, marker :: after :: ls, inCodeBlock = false) else lastTagKey match { case Some(key) => val value = @@ -259,9 +259,9 @@ trait CommentFactoryBase { this: MemberLookupBase => case Some(b :: bs) => (b + endOfLine + marker) :: bs case None => oops("lastTagKey set when no tag exists for key") } - parse0(docBody, tags + (key -> value), lastTagKey, ls, false) + parse0(docBody, tags + (key -> value), lastTagKey, ls, inCodeBlock = false) case None => - parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, false) + parse0(docBody append endOfLine append marker, tags, lastTagKey, ls, inCodeBlock = false) } case SymbolTagRegex(name, sym, body) :: ls if (!inCodeBlock) => @@ -375,7 +375,7 @@ trait CommentFactoryBase { this: MemberLookupBase => } - parse0(new StringBuilder(comment.size), Map.empty, None, clean(comment), false) + parse0(new StringBuilder(comment.size), Map.empty, None, clean(comment), inCodeBlock = false) } @@ -451,7 +451,7 @@ trait CommentFactoryBase { this: MemberLookupBase => else { jumpWhitespace() jump(style) - val p = Paragraph(inline(false)) + val p = Paragraph(inline(isInlineEnd = false)) blockEnded("end of list line ") Some(p) } @@ -510,11 +510,11 @@ trait CommentFactoryBase { this: MemberLookupBase => def para(): Block = { val p = if (summaryParsed) - Paragraph(inline(false)) + Paragraph(inline(isInlineEnd = false)) else { val s = summary() val r = - if (checkParaEnded()) List(s) else List(s, inline(false)) + if (checkParaEnded()) List(s) else List(s, inline(isInlineEnd = false)) summaryParsed = true Paragraph(Chain(r)) } diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala index 829df97fc2..229e26d699 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala @@ -123,7 +123,7 @@ abstract class HtmlPage extends Page { thisPage => case Text(text) => scala.xml.Text(text) case Summary(in) => inlineToHtml(in) case HtmlTag(tag) => scala.xml.Unparsed(tag) - case EntityLink(target, link) => linkToHtml(target, link, true) + case EntityLink(target, link) => linkToHtml(target, link, hasLinks = true) } def linkToHtml(text: Inline, link: LinkTo, hasLinks: Boolean) = link match { diff --git a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala index db9edd165d..5781e680dd 100644 --- a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala +++ b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala @@ -107,14 +107,14 @@ private[html] object SyntaxHigh { case '/' => if (star) { if (level > 0) level -= 1 - if (level == 0) i else multiline(i+1, true) + if (level == 0) i else multiline(i+1, star = true) } else - multiline(i+1, false) + multiline(i+1, star = false) case _ => - multiline(i+1, false) + multiline(i+1, star = false) } } - if (buf(i) == '/') line(i) else multiline(i, true) + if (buf(i) == '/') line(i) else multiline(i, star = true) out.toString } @@ -129,16 +129,16 @@ private[html] object SyntaxHigh { out append ch ch match { case '\\' => - charlit0(i+1, true) + charlit0(i+1, bslash = true) case '\'' if !bslash => i case _ => - if (bslash && '0' <= ch && ch <= '9') charlit0(i+1, true) - else charlit0(i+1, false) + if (bslash && '0' <= ch && ch <= '9') charlit0(i+1, bslash = true) + else charlit0(i+1, bslash = false) } } } - charlit0(j, false) + charlit0(j, bslash = false) out.toString } @@ -150,14 +150,14 @@ private[html] object SyntaxHigh { out append ch ch match { case '\\' => - strlit0(i+1, true) + strlit0(i+1, bslash = true) case '"' if !bslash => i case _ => - strlit0(i+1, false) + strlit0(i+1, bslash = false) } } - strlit0(i, false) + strlit0(i, bslash = false) out.toString } @@ -183,7 +183,7 @@ private[html] object SyntaxHigh { ch match { case 'e' | 'E' => out append ch - expo(i+1, false) + expo(i+1, signed = false) case _ => if (Character.isDigit(ch)) { out append ch @@ -197,7 +197,7 @@ private[html] object SyntaxHigh { ch match { case '+' | '-' if !signed => out append ch - expo(i+1, true) + expo(i+1, signed = true) case _ => if (Character.isDigit(ch)) { out append ch diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index c482134c4b..63509de4b5 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -110,8 +110,8 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp <h1>{ displayName }</h1> </div> - { signature(tpl, true) } - { memberToCommentHtml(tpl, tpl.inTemplate, true) } + { signature(tpl, isSelf = true) } + { memberToCommentHtml(tpl, tpl.inTemplate, isSelf = true) } <div id="mbrsel"> <div id='textfilter'><span class='pre'/><span class='input'><input id='mbrsel-input' type='text' accesskey='/'/></span><span class='post'/></div> @@ -242,7 +242,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp NodeSeq fromSeq (for (conversion <- (tpl.conversions)) yield <div class="conversion" name={ conversion.conversionQualifiedName }> <h3>Inherited by implicit conversion { conversion.conversionShortName } from - { typeToHtml(tpl.resultType, true) } to { typeToHtml(conversion.targetType, true) } + { typeToHtml(tpl.resultType, hasLinks = true) } to { typeToHtml(conversion.targetType, hasLinks = true) } </h3> </div> ) @@ -284,14 +284,14 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp } def memberToHtml(mbr: MemberEntity, inTpl: DocTemplateEntity): NodeSeq = { - val memberComment = memberToCommentHtml(mbr, inTpl, false) + val memberComment = memberToCommentHtml(mbr, inTpl, isSelf = false) <li name={ mbr.definitionName } visbl={ if (mbr.visibility.isProtected) "prt" else "pub" } data-isabs={ mbr.isAbstract.toString } fullComment={ if(memberComment.filter(_.label=="div").isEmpty) "no" else "yes" } group={ mbr.group }> <a id={ mbr.signature }/> <a id={ mbr.signatureCompat }/> - { signature(mbr, false) } + { signature(mbr, isSelf = false) } { memberComment } </li> } @@ -398,7 +398,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp case Some(conv) => <dt class="implicit">Implicit information</dt> ++ { - val targetType = typeToHtml(conv.targetType, true) + val targetType = typeToHtml(conv.targetType, hasLinks = true) val conversionMethod = conv.convertorMethod match { case Left(member) => Text(member.name) case Right(name) => Text(name) @@ -424,7 +424,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp } <dd> - This member is added by an implicit conversion from { typeToHtml(inTpl.resultType, true) } to + This member is added by an implicit conversion from { typeToHtml(inTpl.resultType, hasLinks = true) } to { targetType } performed by method { conversionMethod } in { conversionOwner }. { constraintText } </dd> @@ -486,7 +486,7 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp case nte: NonTemplateMemberEntity if nte.isUseCase => <div class="full-signature-block toggleContainer"> <span class="toggle">Full Signature</span> - <div class="hiddenContent full-signature-usecase">{ signature(nte.useCaseOf.get,true) }</div> + <div class="hiddenContent full-signature-usecase">{ signature(nte.useCaseOf.get,isSelf = true) }</div> </div> case _ => NodeSeq.Empty } @@ -923,13 +923,13 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp if (tpl.universe.settings.useStupidTypes.value) superTpl match { case dtpl: DocTemplateEntity => - val sig = signature(dtpl, false, true) \ "_" + val sig = signature(dtpl, isSelf = false, isReduced = true) \ "_" sig case tpl: TemplateEntity => Text(tpl.name) } else - typeToHtml(superType, true) + typeToHtml(superType, hasLinks = true) private def constraintToHtml(constraint: Constraint): NodeSeq = constraint match { case ktcc: KnownTypeClassConstraint => @@ -941,21 +941,21 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp context-bounded</a> ++ scala.xml.Text(" by " + tcc.typeClassEntity.qualifiedName + " (" + tcc.typeParamName + ": ") ++ templateToHtml(tcc.typeClassEntity) ++ scala.xml.Text(")") case impl: ImplicitInScopeConstraint => - scala.xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, true) ++ scala.xml.Text(" is in scope") + scala.xml.Text("an implicit value of type ") ++ typeToHtml(impl.implicitType, hasLinks = true) ++ scala.xml.Text(" is in scope") case eq: EqualTypeParamConstraint => scala.xml.Text(eq.typeParamName + " is " + eq.rhs.name + " (" + eq.typeParamName + " =:= ") ++ - typeToHtml(eq.rhs, true) ++ scala.xml.Text(")") + typeToHtml(eq.rhs, hasLinks = true) ++ scala.xml.Text(")") case bt: BoundedTypeParamConstraint => scala.xml.Text(bt.typeParamName + " is a superclass of " + bt.lowerBound.name + " and a subclass of " + bt.upperBound.name + " (" + bt.typeParamName + " >: ") ++ - typeToHtml(bt.lowerBound, true) ++ scala.xml.Text(" <: ") ++ - typeToHtml(bt.upperBound, true) ++ scala.xml.Text(")") + typeToHtml(bt.lowerBound, hasLinks = true) ++ scala.xml.Text(" <: ") ++ + typeToHtml(bt.upperBound, hasLinks = true) ++ scala.xml.Text(")") case lb: LowerBoundedTypeParamConstraint => scala.xml.Text(lb.typeParamName + " is a superclass of " + lb.lowerBound.name + " (" + lb.typeParamName + " >: ") ++ - typeToHtml(lb.lowerBound, true) ++ scala.xml.Text(")") + typeToHtml(lb.lowerBound, hasLinks = true) ++ scala.xml.Text(")") case ub: UpperBoundedTypeParamConstraint => scala.xml.Text(ub.typeParamName + " is a subclass of " + ub.upperBound.name + " (" + ub.typeParamName + " <: ") ++ - typeToHtml(ub.upperBound, true) ++ scala.xml.Text(")") + typeToHtml(ub.upperBound, hasLinks = true) ++ scala.xml.Text(")") } } diff --git a/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala b/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala index 92dd05e70a..837d9e6f21 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/diagram/DotDiagramGenerator.scala @@ -321,7 +321,7 @@ class DotDiagramGenerator(settings: doc.Settings) extends DiagramGenerator { val result = if (dotOutput != null) { val src = scala.io.Source.fromString(dotOutput) try { - val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, false) + val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, preserveWS = false) val doc = cpa.document() if (doc != null) transform(doc.docElem) diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala index c00afee064..868c2fc3a4 100644 --- a/src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala +++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactoryImplicitSupport.scala @@ -170,7 +170,7 @@ trait ModelFactoryImplicitSupport { val newContext = context.makeImplicit(context.ambiguousErrors) newContext.macrosEnabled = false val newTyper = global.analyzer.newTyper(newContext) - newTyper.silent(_.typed(appliedTree, EXPRmode, WildcardType), false) match { + newTyper.silent(_.typed(appliedTree, EXPRmode, WildcardType), reportAmbiguousErrors = false) match { case global.analyzer.SilentResultValue(t: Tree) => t case global.analyzer.SilentTypeError(err) => diff --git a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala index 96bba0498c..6395446d3b 100644 --- a/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala +++ b/src/compiler/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala @@ -63,7 +63,7 @@ trait DiagramDirectiveParser { NoDiagramAtAll if (template.comment.isDefined) - makeDiagramFilter(template, template.comment.get.inheritDiagram, defaultFilter, true) + makeDiagramFilter(template, template.comment.get.inheritDiagram, defaultFilter, isInheritanceDiagram = true) else defaultFilter } @@ -72,7 +72,7 @@ trait DiagramDirectiveParser { def makeContentDiagramFilter(template: DocTemplateImpl): DiagramFilter = { val defaultFilter = if (template.isPackage || template.isObject) FullDiagram else NoDiagramAtAll if (template.comment.isDefined) - makeDiagramFilter(template, template.comment.get.contentDiagram, defaultFilter, false) + makeDiagramFilter(template, template.comment.get.contentDiagram, defaultFilter, isInheritanceDiagram = false) else defaultFilter } |