Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
```

```shell
implementation("dev.snipme:highlights:0.8.1")
implementation("dev.snipme:highlights:0.9.0")
```

## Features ✨
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "dev.snipme"
version = "0.8.1"
version = "0.9.0"

kotlin {
// Android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,34 @@ 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(
language = SyntaxLanguage.KOTLIN,
code = code
).build().getCodeStructure()

assertEquals(4, result.keywords.size)
result.printStructure(code)

assertEquals(11, result.keywords.size)
}
}