Package-level declarations

Provides the baseline implementation for keyboard3 markers, marker-aware character strings, descriptors, and parsing facilities.

Types

Link copied to clipboard
@Serializable(with = K3Descriptor.Serializer::class)
class K3Descriptor(val namespace: String, val type: String, val name: String) : K3StringOrDescriptor

Describes something by a qualified name. Its usage is to distinguish "normal" strings from special actions or references.

Link copied to clipboard
class K3Marker

Describes a marker by both unique ID and name. In keyboard3 files, markers are defined using the \m{…markerName} syntax.

Link copied to clipboard
interface K3MarkerPool

A marker pool is a mapping between unique numeric ids and marker names. This is required for efficient runtime storage and comparison of in-band markers. See the discussion of marker ids in K3Marker.

Link copied to clipboard

A mutable marker pool that allocates and maintains the mapping between unique ids and marker names.

Link copied to clipboard

The K3String class represents marker-aware character strings for use in Keyboard3 models and runtimes.

Link copied to clipboard
value class K3StringAtom(val packedValue: Int)
Link copied to clipboard

A mutable sequence of characters and markers. Allows to efficiently build K3String objects.

Link copied to clipboard
sealed interface K3StringOrDescriptor

Union interface which allows a property to either be K3String or K3Descriptor.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This annotation marks all API affected by a required future migration to Kotlin rich errors.

Functions

Link copied to clipboard

Returns this String as a K3String.

Link copied to clipboard
inline fun buildK3String(builderAction: K3StringBuilder.() -> Unit): K3String

Builds new K3String by populating a newly created K3StringBuilder using provided builderAction and then converting it to K3String.

Link copied to clipboard

Returns an immutable and empty marker pool.

Link copied to clipboard

Checks if this string is normalized.

Checks if this K3String is normalized in a marker-aware-manner.

Link copied to clipboard

Returns a new instance of a mutable marker pool.

Link copied to clipboard

Normalizes this string according to UAX#15.

Normalizes this K3String in a marker-aware manner, using the marker algorithm from Unicode TR35.

Link copied to clipboard
context(variableResolver: K3VariableResolver, markerPool: K3MutableMarkerPool)
fun String.toK3String(allowEscapedCodePoints: Boolean = true, allowEscapedMarkers: Boolean = true, allowStringVarRefs: Boolean = true): K3StringOrError

Parses this string to a K3String, and interprets or disallows escaped codepoints, markers, and string variable references.

Link copied to clipboard

Parses this string to a set of K3String objects.