fixed up compile errors after recent visibility rule changes
This commit is contained in:
@@ -34,7 +34,7 @@ import org.jetbrains.jet.lang.resolve.BindingContextUtils
|
|||||||
/** Generates the Kotlin Documentation for the model */
|
/** Generates the Kotlin Documentation for the model */
|
||||||
class KDoc() : KModelCompilerPlugin() {
|
class KDoc() : KModelCompilerPlugin() {
|
||||||
|
|
||||||
override fun processModel(model: KModel) {
|
protected override fun processModel(model: KModel) {
|
||||||
// TODO allow this to be configured; maybe we use configuration on the KotlinModule
|
// TODO allow this to be configured; maybe we use configuration on the KotlinModule
|
||||||
// to define what doclets to use?
|
// to define what doclets to use?
|
||||||
val generator = JavadocStyleHtmlDoclet()
|
val generator = JavadocStyleHtmlDoclet()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ fun main(args: Array<String?>): Unit {
|
|||||||
*/
|
*/
|
||||||
class KDocCompiler() : KotlinCompiler() {
|
class KDocCompiler() : KotlinCompiler() {
|
||||||
|
|
||||||
override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
protected override fun configureEnvironment(environment : CompileEnvironment?, arguments : CompilerArguments?, errStream : PrintStream?) {
|
||||||
super.configureEnvironment(environment, arguments, errStream)
|
super.configureEnvironment(environment, arguments, errStream)
|
||||||
val coreEnvironment = environment?.getEnvironment()
|
val coreEnvironment = environment?.getEnvironment()
|
||||||
if (coreEnvironment != null) {
|
if (coreEnvironment != null) {
|
||||||
@@ -38,11 +38,11 @@ class KDocCompiler() : KotlinCompiler() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createArguments() : CompilerArguments? {
|
protected override fun createArguments() : CompilerArguments? {
|
||||||
return KDocArguments()
|
return KDocArguments()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun usage(target : PrintStream?) {
|
protected override fun usage(target : PrintStream?) {
|
||||||
target?.println("Usage: KDocCompiler -docOutput <docOutputDir> [-output <outputDir>|-jar <jarFileName>] [-stdlib <path to runtime.jar>] [-src <filename or dirname>|-module <module file>] [-includeRuntime]");
|
target?.println("Usage: KDocCompiler -docOutput <docOutputDir> [-output <outputDir>|-jar <jarFileName>] [-stdlib <path to runtime.jar>] [-src <filename or dirname>|-module <module file>] [-includeRuntime]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,11 +99,11 @@ class KDocConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class LongestFirstStringComparator() : Comparator<String> {
|
private class LongestFirstStringComparator() : Comparator<String> {
|
||||||
override fun compare(s1: String?, s2: String?): Int {
|
public override fun compare(s1: String?, s2: String?): Int {
|
||||||
return compareBy(s1, s2, { (s: String) -> s.length() }, { (s: String) -> s })
|
return compareBy(s1, s2, { (s: String) -> s.length() }, { (s: String) -> s })
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(obj : Any?) : Boolean {
|
public override fun equals(obj : Any?) : Boolean {
|
||||||
return obj is LongestFirstStringComparator
|
return obj is LongestFirstStringComparator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -7,7 +7,7 @@ import org.jetbrains.jet.compiler.CompilerPluginContext
|
|||||||
*/
|
*/
|
||||||
class HtmlCompilerPlugin: CompilerPlugin {
|
class HtmlCompilerPlugin: CompilerPlugin {
|
||||||
|
|
||||||
override fun processFiles(context: CompilerPluginContext?) {
|
public override fun processFiles(context: CompilerPluginContext?) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
val bindingContext = context.getContext()
|
val bindingContext = context.getContext()
|
||||||
val files = context.getFiles()
|
val files = context.getFiles()
|
||||||
|
|||||||
+6
-7
@@ -8,28 +8,27 @@ import com.intellij.psi.PsiComment
|
|||||||
|
|
||||||
class HtmlKotlinVisitor: JetTreeVisitor<StringBuilder>() {
|
class HtmlKotlinVisitor: JetTreeVisitor<StringBuilder>() {
|
||||||
|
|
||||||
override fun visitFile(file: PsiFile?) {
|
public override fun visitFile(file: PsiFile?) {
|
||||||
if (file is JetFile) {
|
if (file is JetFile) {
|
||||||
val data = StringBuilder()
|
val data = StringBuilder()
|
||||||
visitJetFile(file, data)
|
visitJetFile(file, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
override fun visitJetFile(file: JetFile?, data: StringBuilder?): Void? {
|
public override fun visitJetFile(file: JetFile?, data: StringBuilder?): Void? {
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
println("============ Jet File ${file.getName()}")
|
println("============ Jet File ${file.getName()}")
|
||||||
val data = StringBuilder()
|
|
||||||
acceptChildren(file, data)
|
acceptChildren(file, data)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun visitClassObject(classObject: JetClassObject?, data: StringBuilder?): Void? {
|
public override fun visitClassObject(classObject: JetClassObject?, data: StringBuilder?): Void? {
|
||||||
println("============ class $classObject data $data")
|
println("============ class $classObject data $data")
|
||||||
return super.visitClassObject(classObject, data)
|
return super.visitClassObject(classObject, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun visitClass(klass: JetClass?, data: StringBuilder?): Void? {
|
public override fun visitClass(klass: JetClass?, data: StringBuilder?): Void? {
|
||||||
println("============ class $klass")
|
println("============ class $klass")
|
||||||
if (klass != null) {
|
if (klass != null) {
|
||||||
acceptChildren(klass, data)
|
acceptChildren(klass, data)
|
||||||
@@ -40,13 +39,13 @@ class HtmlKotlinVisitor: JetTreeVisitor<StringBuilder>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun visitClassBody(classBody: JetClassBody?, data: StringBuilder?): Void? {
|
public override fun visitClassBody(classBody: JetClassBody?, data: StringBuilder?): Void? {
|
||||||
println("============ class body $classBody data $data")
|
println("============ class body $classBody data $data")
|
||||||
return super.visitClassBody(classBody, data)
|
return super.visitClassBody(classBody, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun visitFunctionType(fnType: JetFunctionType?, data: StringBuilder?): Void? {
|
public override fun visitFunctionType(fnType: JetFunctionType?, data: StringBuilder?): Void? {
|
||||||
println("======================= function Type $fnType")
|
println("======================= function Type $fnType")
|
||||||
return super.visitFunctionType(fnType, data)
|
return super.visitFunctionType(fnType, data)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ abstract class KModelCompilerPlugin: CompilerPlugin {
|
|||||||
public open var config: KDocConfig = KDocConfig()
|
public open var config: KDocConfig = KDocConfig()
|
||||||
|
|
||||||
|
|
||||||
override fun processFiles(context: CompilerPluginContext?) {
|
public override fun processFiles(context: CompilerPluginContext?) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
val bindingContext = context.getContext()
|
val bindingContext = context.getContext()
|
||||||
val sources = context.getFiles()
|
val sources = context.getFiles()
|
||||||
@@ -23,5 +23,5 @@ abstract class KModelCompilerPlugin: CompilerPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun processModel(model: KModel): Unit
|
protected abstract fun processModel(model: KModel): Unit
|
||||||
}
|
}
|
||||||
@@ -564,7 +564,7 @@ class KModel(var context: BindingContext, val config: KDocConfig) {
|
|||||||
|
|
||||||
class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate): LinkRenderer() {
|
class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate): LinkRenderer() {
|
||||||
|
|
||||||
override fun render(node: WikiLinkNode?): Rendering? {
|
public override fun render(node: WikiLinkNode?): Rendering? {
|
||||||
val answer = super.render(node)
|
val answer = super.render(node)
|
||||||
if (answer != null) {
|
if (answer != null) {
|
||||||
val text = answer.text
|
val text = answer.text
|
||||||
@@ -668,15 +668,15 @@ class TemplateLinkRenderer(val annotated: KAnnotated, val template: KDocTemplate
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node: RefLinkNode?, url: String?, title: String?, text: String?): Rendering? {
|
public override fun render(node: RefLinkNode?, url: String?, title: String?, text: String?): Rendering? {
|
||||||
return super.render(node, url, title, text)
|
return super.render(node, url, title, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node: AutoLinkNode?): Rendering? {
|
public override fun render(node: AutoLinkNode?): Rendering? {
|
||||||
return super.render(node)
|
return super.render(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node: ExpLinkNode?, text: String?): Rendering? {
|
public override fun render(node: ExpLinkNode?, text: String?): Rendering? {
|
||||||
return super.render(node, text)
|
return super.render(node, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,7 +706,7 @@ abstract class KAnnotated(val model: KModel, val declarationDescriptor: Declarat
|
|||||||
|
|
||||||
abstract class KNamed(val name: String, model: KModel, declarationDescriptor: DeclarationDescriptor): KAnnotated(model, declarationDescriptor), Comparable<KNamed> {
|
abstract class KNamed(val name: String, model: KModel, declarationDescriptor: DeclarationDescriptor): KAnnotated(model, declarationDescriptor), Comparable<KNamed> {
|
||||||
|
|
||||||
override fun compareTo(other: KNamed): Int = name.compareTo(other.name)
|
public override fun compareTo(other: KNamed): Int = name.compareTo(other.name)
|
||||||
|
|
||||||
open fun equals(other: KPackage) = name == other.name
|
open fun equals(other: KPackage) = name == other.name
|
||||||
|
|
||||||
@@ -718,7 +718,7 @@ class KPackage(model: KModel, val descriptor: NamespaceDescriptor,
|
|||||||
val name: String,
|
val name: String,
|
||||||
var local: Boolean = false): KClassOrPackage(model, descriptor), Comparable<KPackage> {
|
var local: Boolean = false): KClassOrPackage(model, descriptor), Comparable<KPackage> {
|
||||||
|
|
||||||
override fun compareTo(other: KPackage): Int = name.compareTo(other.name)
|
public override fun compareTo(other: KPackage): Int = name.compareTo(other.name)
|
||||||
|
|
||||||
fun equals(other: KPackage) = name == other.name
|
fun equals(other: KPackage) = name == other.name
|
||||||
|
|
||||||
@@ -839,7 +839,7 @@ class KClass(val pkg: KPackage, val descriptor: ClassDescriptor,
|
|||||||
var nestedClasses: List<KClass> = arrayList<KClass>(),
|
var nestedClasses: List<KClass> = arrayList<KClass>(),
|
||||||
var sourceLine: Int = 2): KClassOrPackage(pkg.model, descriptor), Comparable<KClass> {
|
var sourceLine: Int = 2): KClassOrPackage(pkg.model, descriptor), Comparable<KClass> {
|
||||||
|
|
||||||
override fun compareTo(other: KClass): Int = name.compareTo(other.name)
|
public override fun compareTo(other: KClass): Int = name.compareTo(other.name)
|
||||||
|
|
||||||
fun equals(other: KClass) = name == other.name
|
fun equals(other: KClass) = name == other.name
|
||||||
|
|
||||||
@@ -924,7 +924,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
|||||||
|
|
||||||
public val parameterTypeText: String = parameters.map{ it.aType.name }.makeString(", ")
|
public val parameterTypeText: String = parameters.map{ it.aType.name }.makeString(", ")
|
||||||
|
|
||||||
override fun compareTo(other: KFunction): Int {
|
public override fun compareTo(other: KFunction): Int {
|
||||||
var answer = name.compareTo(other.name)
|
var answer = name.compareTo(other.name)
|
||||||
if (answer == 0) {
|
if (answer == 0) {
|
||||||
answer = parameterTypeText.compareTo(other.parameterTypeText)
|
answer = parameterTypeText.compareTo(other.parameterTypeText)
|
||||||
@@ -952,7 +952,7 @@ class KFunction(val descriptor: CallableDescriptor, val owner: KClassOrPackage,
|
|||||||
class KProperty(val owner: KClassOrPackage, val descriptor: PropertyDescriptor, val name: String,
|
class KProperty(val owner: KClassOrPackage, val descriptor: PropertyDescriptor, val name: String,
|
||||||
val returnType: KType, val extensionClass: KClass?): KAnnotated(owner.model, descriptor), Comparable<KProperty> {
|
val returnType: KType, val extensionClass: KClass?): KAnnotated(owner.model, descriptor), Comparable<KProperty> {
|
||||||
|
|
||||||
override fun compareTo(other: KProperty): Int = name.compareTo(other.name)
|
public override fun compareTo(other: KProperty): Int = name.compareTo(other.name)
|
||||||
|
|
||||||
public val link: String = "$name"
|
public val link: String = "$name"
|
||||||
|
|
||||||
|
|||||||
@@ -32,22 +32,22 @@ class PegdownTest() : TestCase() {
|
|||||||
|
|
||||||
class CustomLinkRenderer() : LinkRenderer() {
|
class CustomLinkRenderer() : LinkRenderer() {
|
||||||
|
|
||||||
override fun render(node : WikiLinkNode?) : Rendering? {
|
public override fun render(node : WikiLinkNode?) : Rendering? {
|
||||||
println("LinkRenderer.render(WikiLinkNode): $node")
|
println("LinkRenderer.render(WikiLinkNode): $node")
|
||||||
return super.render(node)
|
return super.render(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node : RefLinkNode?, url : String?, title : String?, text : String?) : Rendering? {
|
public override fun render(node : RefLinkNode?, url : String?, title : String?, text : String?) : Rendering? {
|
||||||
println("LinkRenderer.render(RefLinkNode): $node url: $url title: $title text: $text")
|
println("LinkRenderer.render(RefLinkNode): $node url: $url title: $title text: $text")
|
||||||
return super.render(node, url, title, text)
|
return super.render(node, url, title, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node : AutoLinkNode?) : Rendering? {
|
public override fun render(node : AutoLinkNode?) : Rendering? {
|
||||||
println("LinkRenderer.render(AutoLinkNode): $node")
|
println("LinkRenderer.render(AutoLinkNode): $node")
|
||||||
return super.render(node)
|
return super.render(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun render(node : ExpLinkNode?, text : String?) : Rendering? {
|
public override fun render(node : ExpLinkNode?, text : String?) : Rendering? {
|
||||||
println("LinkRenderer.render(ExpLinkNode): $node text: $text")
|
println("LinkRenderer.render(ExpLinkNode): $node text: $text")
|
||||||
return super.render(node, text)
|
return super.render(node, text)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ import junit.framework.TestCase
|
|||||||
import junit.framework.Assert.*
|
import junit.framework.Assert.*
|
||||||
|
|
||||||
class EmailTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
class EmailTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
||||||
override fun render() {
|
public override fun render() {
|
||||||
print("Hello there $name and how are you? Today is $time. Kotlin rocks")
|
print("Hello there $name and how are you? Today is $time. Kotlin rocks")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MoreDryTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
class MoreDryTemplate(var name: String = "James", var time: Date = Date()) : TextTemplate() {
|
||||||
override fun render() {
|
public override fun render() {
|
||||||
+"Hey there $name and how are you? Today is $time. Kotlin rocks"
|
+"Hey there $name and how are you? Today is $time. Kotlin rocks"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import java.util.List
|
|||||||
fun ResultSet.iterator() : Iterator<ResultSet> {
|
fun ResultSet.iterator() : Iterator<ResultSet> {
|
||||||
val rs = this
|
val rs = this
|
||||||
return object : Iterator<ResultSet>{
|
return object : Iterator<ResultSet>{
|
||||||
override val hasNext : Boolean
|
public override val hasNext : Boolean
|
||||||
get() = rs.next()
|
get() = rs.next()
|
||||||
|
|
||||||
override fun next() : ResultSet = rs
|
public override fun next() : ResultSet = rs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user