com.skillw.asahi.internal.namespacing.infix.linking.InfixMap.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Pouvoir Show documentation
Show all versions of Pouvoir Show documentation
Bukkit Script Engine Plugin.
package com.skillw.asahi.internal.namespacing.infix.linking
import com.skillw.asahi.api.annotation.AsahiInfix
import com.skillw.asahi.api.member.parser.infix.namespacing.BaseInfix
/**
* @className ActionMap
*
* @author Glom
* @date 2022/8/9 16:26 Copyright 2022 user.
*/
@AsahiInfix
internal object InfixMap : BaseInfix>(MutableMap::class.java) {
init {
infix("get") { map ->
val key = parse()
map[key]
}
infix("put", "set") { map ->
map as? MutableMap? ?: error("MutableMap")
val key = parse()
expect("to")
val value = parse()
map[key] = value
value
}
infix("putAll") { map ->
map as? MutableMap? ?: error("MutableMap")
val other = parse
© 2015 - 2024 Weber Informatics LLC | Privacy Policy