mirror of
https://github.com/github/codeql.git
synced 2026-02-23 02:13:41 +01:00
Using:
java -jar ktfmt-0.46-jar-with-dependencies.jar --kotlinlang-style java/kotlin-extractor/**/*.kt
22 lines
724 B
Kotlin
22 lines
724 B
Kotlin
package com.github.codeql
|
|
|
|
/** This represents a label (`#...`) in a TRAP file. */
|
|
interface Label<T : AnyDbType> {
|
|
fun <U : AnyDbType> cast(): Label<U> {
|
|
@Suppress("UNCHECKED_CAST") return this as Label<U>
|
|
}
|
|
}
|
|
|
|
/** The label `#i`, e.g. `#123`. Most labels we generate are of this form. */
|
|
class IntLabel<T : AnyDbType>(val i: Int) : Label<T> {
|
|
override fun toString(): String = "#$i"
|
|
}
|
|
|
|
/**
|
|
* The label `#name`, e.g. `#compilation`. This is used when labels are shared between different
|
|
* components (e.g. when both the interceptor and the extractor need to refer to the same label).
|
|
*/
|
|
class StringLabel<T : AnyDbType>(val name: String) : Label<T> {
|
|
override fun toString(): String = "#$name"
|
|
}
|