diff --git a/build.gradle b/build.gradle index 85797a0..db96da4 100644 --- a/build.gradle +++ b/build.gradle @@ -15,15 +15,14 @@ java { } dokka { - outputFormat = 'html' + outputFormat = 'html-as-java' outputDirectory = "$buildDir/dokka" } task javadocJar(type: Jar) { archiveClassifier = 'javadoc' dependsOn dokka - from("$buildDir/dokka/isbd-parser") - from("$buildDir/dokka/style.css") + from("$buildDir/dokka/") } publishing { @@ -95,6 +94,7 @@ repositories { dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' + implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1' api 'com.github.norswap:autumn:80abd5c207' testImplementation 'junit:junit:4.12' } diff --git a/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/TitleStatementParser.kt b/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/TitleStatementParser.kt index f1f13f7..567bb3b 100644 --- a/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/TitleStatementParser.kt +++ b/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/TitleStatementParser.kt @@ -62,7 +62,7 @@ class TitleStatementParser : TitleStatementGrammar() { return result.value_stack.mapNotNull { it as TitleStatement } } - throw Exception(result.toString()) + return emptyList() } /** Produces all possible parses of the given title statement string. diff --git a/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/ast/Title.kt b/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/ast/Title.kt index 122d0d2..df3aee9 100644 --- a/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/ast/Title.kt +++ b/src/main/kotlin/ca/voidstarzero/isbd/titlestatement/ast/Title.kt @@ -1,9 +1,18 @@ package ca.voidstarzero.isbd.titlestatement.ast +import com.fasterxml.jackson.annotation.JsonTypeInfo + /** * Base class for titles. */ -sealed class Title() : Node() {} +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type" +) +sealed class Title() : Node() { + val type = this::class.java.simpleName +} /** * A class holding the title part of a title statement.