com.skillw.asahi.internal.parser.prefix.top.PrefixCallParser.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.
The newest version!
package com.skillw.asahi.internal.parser.prefix.top
import com.skillw.asahi.api.annotation.AsahiTopParser
import com.skillw.asahi.api.member.context.AsahiContext
import com.skillw.asahi.api.member.lexer.AsahiLexer
import com.skillw.asahi.api.member.parser.prefix.TopPrefixParser
import com.skillw.asahi.api.member.quest.Quester
@AsahiTopParser
internal object PrefixCallParser : TopPrefixParser("call-function", 999) {
override fun AsahiLexer.canParse(token: String): Boolean {
return hasPrefix(token)
}
override fun AsahiLexer.parse(token: String): Quester? {
return getPrefix(token)?.parseWith(this@parse) as Quester?
}
override fun Quester.topQuester(): Quester {
return object : Quester {
override fun AsahiContext.execute(): R {
return [email protected](this)
}
override fun toString(): String {
return "Prefix Quester - $key ${this@topQuester}"
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy