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

com.skillw.asahi.internal.namespacing.infix.InfixMatchResult.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
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