All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.skillw.asahi.api.member.parser.prefix.namespacing.PrefixParser.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
package com.skillw.asahi.api.member.parser.prefix.namespacing

import com.skillw.asahi.api.member.context.AsahiContext
import com.skillw.asahi.api.member.lexer.AsahiLexer
import com.skillw.asahi.api.member.quest.Quester

/**
 * @className PrefixParser
 *
 * 前缀解释器的编译上下文
 *
 * @author Glom
 * @date 2022/12/27 19:31 Copyright 2022 user.
 */
class PrefixParser private constructor(
    reader: AsahiLexer,
) : AsahiLexer by reader {
    companion object {
        fun  AsahiLexer.prefixParser(): PrefixParser {
            return PrefixParser(this)
        }
    }

    /**
     * 结果
     *
     * @param exec 结果内容
     * @param R 返回类型
     * @return 返回的结果
     * @receiver
     */
    fun  result(exec: AsahiContext.() -> R): Quester {
        return Quester { exec() }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy