aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-06-16 17:49:02 +0200
committerDmitry Jemerov <yole@jetbrains.com>2015-06-16 17:49:02 +0200
commitc858ffdfdc18d855c7964a686a44dc4aa118db10 (patch)
treed3b9e6a014d230d4886ee92defe0b2a422c156e0
parentfa8bdfa56d847b81206aaea24e2b081bf3d666b4 (diff)
downloaddokka-c858ffdfdc18d855c7964a686a44dc4aa118db10.tar.gz
dokka-c858ffdfdc18d855c7964a686a44dc4aa118db10.tar.bz2
dokka-c858ffdfdc18d855c7964a686a44dc4aa118db10.zip
some cleanup
-rw-r--r--src/Kotlin/ContentBuilder.kt2
-rw-r--r--src/Kotlin/DocumentationBuilder.kt15
-rw-r--r--src/Model/Content.kt6
3 files changed, 10 insertions, 13 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index 01feef34..373967cb 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -22,7 +22,7 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver
nodeStack.push(target)
tree.visit {node, processChildren ->
- val parent = nodeStack.peek()!!
+ val parent = nodeStack.peek()
fun appendNodeWithChildren(content: ContentBlock) {
nodeStack.push(content)
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 4af53d88..8bbd7743 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -425,6 +425,7 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
}
fun ScriptDescriptor.build(): DocumentationNode = getClassDescriptor().build()
+
fun ClassDescriptor.build(): DocumentationNode {
val kind = when (getKind()) {
ClassKind.OBJECT -> Kind.Object
@@ -449,9 +450,9 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
}
val members = getDefaultType().getMemberScope().getAllDescriptors().filter { it != getCompanionObjectDescriptor() }
node.appendChildren(members, DocumentationReference.Kind.Member)
- val defaultObjectDescriptor = getCompanionObjectDescriptor()
- if (defaultObjectDescriptor != null) {
- node.appendChildren(defaultObjectDescriptor.getDefaultType().getMemberScope().getAllDescriptors(),
+ val companionObjectDescriptor = getCompanionObjectDescriptor()
+ if (companionObjectDescriptor != null) {
+ node.appendChildren(companionObjectDescriptor.getDefaultType().getMemberScope().getAllDescriptors(),
DocumentationReference.Kind.Member)
}
node.appendAnnotations(this)
@@ -545,11 +546,11 @@ class DocumentationBuilder(val resolutionFacade: ResolutionFacade,
}
val token = if (arity == 2) {
- OperatorConventions.BINARY_OPERATION_NAMES.inverse().get(getName()) ?:
- OperatorConventions.ASSIGNMENT_OPERATIONS.inverse().get(getName()) ?:
- OperatorConventions.BOOLEAN_OPERATIONS.inverse().get(getName())
+ OperatorConventions.BINARY_OPERATION_NAMES.inverse()[getName()] ?:
+ OperatorConventions.ASSIGNMENT_OPERATIONS.inverse()[getName()] ?:
+ OperatorConventions.BOOLEAN_OPERATIONS.inverse()[getName()]
} else if (arity == 1) {
- OperatorConventions.UNARY_OPERATION_NAMES.inverse().get(getName())
+ OperatorConventions.UNARY_OPERATION_NAMES.inverse()[getName()]
}
else null
diff --git a/src/Model/Content.kt b/src/Model/Content.kt
index b442cd73..810d6417 100644
--- a/src/Model/Content.kt
+++ b/src/Model/Content.kt
@@ -2,11 +2,7 @@ package org.jetbrains.dokka
import kotlin.properties.Delegates
-public abstract class ContentNode {
- companion object {
- val empty = ContentEmpty
- }
-}
+public abstract class ContentNode
public object ContentEmpty : ContentNode()