Root namespace constant

This commit is contained in:
Andrew Golovashevich 2025-03-24 07:14:55 +03:00
parent 7eb5397a93
commit f1bd010c62

View File

@ -12,7 +12,7 @@ public class Namespace(
return name return name
} }
private fun _formatTableName(name: String) = this._path.joinToString(prefix = "::", separator = "::", postfix = "::${this.name}::${name}") private fun _formatTableName(name: String) = this._path.joinToString(separator = "::", postfix = "::${this.name}::${name}")
public fun subnamespace(name: String): Namespace = public fun subnamespace(name: String): Namespace =
Namespace(this._allocName(name), this._path + this.name) Namespace(this._allocName(name), this._path + this.name)
@ -35,4 +35,8 @@ public class Namespace(
private class DefaultTableConstructorWrapper<tUE : Any>(private val fn: (table: Table, members: TableConstructor.Scope) -> tUE) : TableConstructor<tUE> { private class DefaultTableConstructorWrapper<tUE : Any>(private val fn: (table: Table, members: TableConstructor.Scope) -> tUE) : TableConstructor<tUE> {
override fun createTable(table: Table, members: TableConstructor.Scope): tUE = this.fn(table, members) override fun createTable(table: Table, members: TableConstructor.Scope): tUE = this.fn(table, members)
} }
public companion object {
public val ROOT: Namespace = Namespace("", arrayOf())
}
} }