LanguageDataMap

class LanguageDataMap(data: Map<String, Any?>)

A type-safe wrapper around language data maps.

Provides typed access to language data values that are normally stored as Map<String, Any?>. Use languageDataMapOf to construct instances.

val data = languageDataMapOf(
LanguageDataKey.COMMENT_TOKENS of mapOf("line" to "//"),
LanguageDataKey.WORD_CHARS of "$"
)
val tokens = data[LanguageDataKey.COMMENT_TOKENS] // Map<String, Any>?

Constructors

Link copied to clipboard
constructor(data: Map<String, Any?>)

Functions

Link copied to clipboard

Check whether the map contains a given key.

Link copied to clipboard
operator fun <T> get(key: LanguageDataKey<T>): T?

Look up a value by its type-safe key. Returns null if the key is absent.

Link copied to clipboard
fun toMap(): Map<String, Any?>

Convert back to a raw map for interop with the languageData facet.