net.akehurst.language-agl-processor
Version:
168 lines (166 loc) • 3.95 kB
JavaScript
import {
LinkedHashMap1zhqxkxv3xnkl as LinkedHashMap,
Unit_instance104q5opgivhr8 as Unit_instance,
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
KtMap140uvy3s5zad8 as KtMap,
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
VOID7hggqo3abtya as VOID,
KtMutableMap1kqeifoi36kpz as KtMutableMap,
ensureNotNull1e947j3ixpazm as ensureNotNull,
ArrayList3it5z8td81qkl as ArrayList,
last1vo29oleiqj36 as last,
toMutableSetjdpdbr9jsqq8 as toMutableSet,
toSet2orjxp16sotqu as toSet,
} from './kotlin-kotlin-stdlib.mjs';
//region block: imports
//endregion
//region block: pre-declaration
class CachedValue {
constructor(initializer) {
this.initializer = initializer;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.dp_1 = LinkedHashMap.l4();
}
ep(_set____db54di) {
this.initializer = _set____db54di;
}
fp() {
return this.initializer;
}
get(key) {
var tmp;
if (this.dp_1.x2(key)) {
tmp = this.dp_1.z2(key);
} else {
var out = this.initializer(key);
// Inline function 'kotlin.collections.set' call
this.dp_1.r2(key, out);
tmp = out;
}
return tmp;
}
set(key, value) {
// Inline function 'kotlin.collections.set' call
this.dp_1.r2(key, value);
}
reset(key) {
this.dp_1.s2(key);
}
resetAll() {
this.dp_1.n2();
}
}
class MapNonNull {}
class MutableMapNonNull {}
class MutableMapNonNullDefault {
constructor(map) {
this.gp_1 = map;
}
z2(key) {
return ensureNotNull(this.gp_1.z2(key));
}
a1() {
return this.gp_1.a1();
}
x2(key) {
return this.gp_1.x2(key);
}
y2(value) {
return this.gp_1.y2(value);
}
asJsReadonlyMapView() {
return this.gp_1.asJsReadonlyMapView();
}
v() {
return this.gp_1.v();
}
u2() {
return this.gp_1.u2();
}
v2() {
return this.gp_1.v2();
}
w2() {
return this.gp_1.w2();
}
r2(key, value) {
return this.gp_1.r2(key, value);
}
s2(key) {
return this.gp_1.s2(key);
}
t2(from) {
this.gp_1.t2(from);
}
n2() {
this.gp_1.n2();
}
asJsMapView() {
return this.gp_1.asJsMapView();
}
}
class Stack {
constructor() {
var tmp = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.hp_1 = ArrayList.y();
this.elements = this.hp_1;
}
ek() {
return this.elements;
}
clear() {
this.hp_1.n2();
}
push(element) {
this.hp_1.r(element);
}
pop() {
var v = last(this.hp_1);
this.hp_1.q2(this.hp_1.v() - 1 | 0);
return v;
}
peek() {
return last(this.hp_1);
}
}
//endregion
function cached(initializer) {
return new CachedValue(initializer);
}
function transitveClosure(_this__u8e3s4, function_0) {
var result = toMutableSet(_this__u8e3s4);
var newThings = toMutableSet(_this__u8e3s4);
var newStuff = true;
while (newStuff) {
var temp = toSet(newThings);
newThings.n2();
var _iterator__ex2g4s = temp.s();
while (_iterator__ex2g4s.t()) {
var nt = _iterator__ex2g4s.u();
var s = function_0(nt);
newThings.x(s);
}
newThings.q1(result);
newStuff = result.x(newThings);
}
return result;
}
//region block: post-declaration
initMetadataForClass(CachedValue, 'CachedValue');
initMetadataForInterface(MapNonNull, 'MapNonNull', VOID, VOID, [KtMap]);
initMetadataForInterface(MutableMapNonNull, 'MutableMapNonNull', VOID, VOID, [MapNonNull, KtMutableMap]);
initMetadataForClass(MutableMapNonNullDefault, 'MutableMapNonNullDefault', VOID, VOID, [MutableMapNonNull, KtMutableMap]);
initMetadataForClass(Stack, 'Stack', Stack);
//endregion
//region block: exports
export {
cached as cached,
CachedValue as CachedValue,
MutableMapNonNullDefault as MutableMapNonNullDefault,
Stack as Stack,
transitveClosure as transitveClosure,
};
//endregion
//# sourceMappingURL=net.akehurst.kotlinx-kotlinx-collections.mjs.map