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

commonMain.com.sunnychung.lib.multiplatform.kotlite.extension.KotliteCustomExtension.kt Maven / Gradle / Ivy

Go to download

A Kotlin Multiplatform library to interpret Kotlite code, which is a subset of Kotlin language, in runtime in a safe way.

The newest version!
package com.sunnychung.lib.multiplatform.kotlite.extension

import com.sunnychung.lib.multiplatform.kotlite.Parser
import com.sunnychung.lib.multiplatform.kotlite.lexer.Lexer
import com.sunnychung.lib.multiplatform.kotlite.model.SymbolTable

fun String.toDataType(symbolTable: SymbolTable) =
    Parser(Lexer("-", this)).type(isParseDottedIdentifiers = true, isIncludeLastIdentifierAsTypeName = true)
        .let { symbolTable.assertToDataType(it) }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy