com.skillw.asahi.internal.namespacing.infix.InfixMatchResult.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
import com.skillw.asahi.api.annotation.AsahiInfix
import com.skillw.asahi.api.member.parser.infix.namespacing.BaseInfix
@AsahiInfix
internal object InfixMatchResult : BaseInfix(MatchResult::class.java, "regex") {
init {
infix("value") { result ->
result.value
}
infix("groups") { result ->
if (expect("of")) {
result.groups[parseString()]?.value
}
if (expect("at")) {
result.groups[parseInt()]?.value
} else
result.groupValues
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy