Root namespace constant
This commit is contained in:
parent
7eb5397a93
commit
f1bd010c62
@ -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())
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user