From aaa96ef8d5f190be087deefe5ed2bced885e7f3b Mon Sep 17 00:00:00 2001 From: tkadziolka Date: Wed, 15 May 2024 07:27:41 +0200 Subject: [PATCH] Removed value keyword and bumped version to 0.9.0 --- README.md | 2 +- build.gradle.kts | 2 +- .../highlights/internal/SyntaxTokens.kt | 4 +-- .../internal/language/KotlinTest.kt | 32 +++++++++++++------ 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 893f69c..4730d4f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ repositories { ``` ```shell -implementation("dev.snipme:highlights:0.8.1") +implementation("dev.snipme:highlights:0.9.0") ``` ## Features ✨ diff --git a/build.gradle.kts b/build.gradle.kts index 30aa017..2a521a7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "dev.snipme" -version = "0.8.1" +version = "0.9.0" kotlin { // Android diff --git a/src/commonMain/kotlin/dev/snipme/highlights/internal/SyntaxTokens.kt b/src/commonMain/kotlin/dev/snipme/highlights/internal/SyntaxTokens.kt index 0bdee93..7a1a351 100644 --- a/src/commonMain/kotlin/dev/snipme/highlights/internal/SyntaxTokens.kt +++ b/src/commonMain/kotlin/dev/snipme/highlights/internal/SyntaxTokens.kt @@ -28,8 +28,8 @@ internal object SyntaxTokens { coroutine,crossinline,data,delegate,dynamic,do,else,enum,expect,external,false,final, finally,for,fun,get,if,import,in,!in,infix,inline,interface,internal,is,!is,lazy,lateinit, native,null,object,open,operator,out,override,package,private,protected,public,reified, - return,sealed,set,super,suspend,tailrec,this,throw,true,try,typealias,typeof,val,value,var, - vararg,when,while,yield + return,sealed,set,super,suspend,tailrec,this,throw,true,try,typealias,typeof,val,var,vararg, + when,while,yield """.toTokenList() val RUST_KEYWORDS = """ diff --git a/src/commonTest/kotlin/dev/snipme/highlights/internal/language/KotlinTest.kt b/src/commonTest/kotlin/dev/snipme/highlights/internal/language/KotlinTest.kt index 010fc5e..a7c89b7 100644 --- a/src/commonTest/kotlin/dev/snipme/highlights/internal/language/KotlinTest.kt +++ b/src/commonTest/kotlin/dev/snipme/highlights/internal/language/KotlinTest.kt @@ -10,15 +10,25 @@ class KotlinTest { @Test fun test() { val code = """ - val intent = 0 - copy(input = input(intent.value)) // highlights "value" - - // calling configure() is equivalent to: - - val new = 1 - - val initialPages = 0 - + val intent = 0 + copy(input = input(intent.value)) // highlights "value" + + // calling configure() is equivalent to: + + val new = 1 + + val initialPages = 0 + + // Visibility modifiers + internal val internalVar: Int = 10 + private fun privateFunction() { + println("This is a private function") + } + + // Data types + val number: Int = 42 + val pi: Double = 3.14 + val isValid: Boolean = true """.trimIndent() val result = Highlights.Builder( @@ -26,6 +36,8 @@ class KotlinTest { code = code ).build().getCodeStructure() - assertEquals(4, result.keywords.size) + result.printStructure(code) + + assertEquals(11, result.keywords.size) } } \ No newline at end of file