Last active
February 24, 2017 12:39
-
-
Save mrdziuban/55293da639a9f67d91a9f8d09d4e607b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elixirscript ':console.log("test")' --elixir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Bootstrap from './Elixir.Bootstrap'; | |
const Elixir = {}; | |
Elixir.start = function(app, args) { | |
app.__load(Elixir).start(Symbol.for('normal'), args) | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl').__exports; | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Atom = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Atom').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$BitString = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.BitString').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$List = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.List').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Tuple = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Tuple').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Integer = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Integer').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Float = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Float').__load(Elixir); | |
let impls = []; | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Atom) | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$BitString) | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$List) | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Tuple) | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Integer) | |
impls.push(Elixir$ElixirScript$String$Chars$DefImpl$Elixir$Float) | |
const __exports = impls; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl').__exports = __exports | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl').__exports; | |
const Elixir$ElixirScript$Enumerable$DefImpl$Elixir$List = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.List').__load(Elixir); | |
const Elixir$ElixirScript$Enumerable$DefImpl$Elixir$Map = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.Map').__load(Elixir); | |
let impls = []; | |
impls.push(Elixir$ElixirScript$Enumerable$DefImpl$Elixir$List) | |
impls.push(Elixir$ElixirScript$Enumerable$DefImpl$Elixir$Map) | |
const __exports = impls; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl').__exports = __exports | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl').__exports; | |
const Elixir$ElixirScript$Collectable$DefImpl$Elixir$List = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.List').__load(Elixir); | |
const Elixir$ElixirScript$Collectable$DefImpl$Elixir$BitString = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.BitString').__load(Elixir); | |
const Elixir$ElixirScript$Collectable$DefImpl$Elixir$Map = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.Map').__load(Elixir); | |
let impls = []; | |
impls.push(Elixir$ElixirScript$Collectable$DefImpl$Elixir$List) | |
impls.push(Elixir$ElixirScript$Collectable$DefImpl$Elixir$BitString) | |
impls.push(Elixir$ElixirScript$Collectable$DefImpl$Elixir$Map) | |
const __exports = impls; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl').__exports = __exports | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Agent').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Agent').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Agent').__exports; | |
const get = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(agent, fun) { | |
let [current_state] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Store.read(agent)); | |
return fun(current_state); | |
})); | |
const get_and_update = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(agent, fun) { | |
let [current_state] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Store.read(agent)); | |
let [val, new_state] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
}), fun(current_state)); | |
let _ref = new Bootstrap.Core.Tuple(val, new_state); | |
Bootstrap.Core.Store.update(agent, new_state); | |
return val; | |
})); | |
const start = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(fun, options) { | |
let [pid] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), new Bootstrap.Core.PID()); | |
let [name] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return null; | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return Elixir$ElixirScript$Keyword.get(options, Symbol.for('name')); | |
})).call(this, Elixir$ElixirScript$Keyword.has_key__qmark__(options, Symbol.for('name')))); | |
Bootstrap.Core.Store.create(pid, fun(), name); | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), pid); | |
})); | |
const start_link = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(fun, options) { | |
let [pid] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), new Bootstrap.Core.PID()); | |
let [name] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return null; | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return Elixir$ElixirScript$Keyword.get(options, Symbol.for('name')); | |
})).call(this, Elixir$ElixirScript$Keyword.has_key__qmark__(options, Symbol.for('name')))); | |
Bootstrap.Core.Store.create(pid, fun(), name); | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), pid); | |
})); | |
const stop = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(agent) { | |
Bootstrap.Core.Store.remove(agent); | |
return Symbol.for('ok'); | |
})); | |
const update = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(agent, fun) { | |
let [current_state] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Store.read(agent)); | |
Bootstrap.Core.Store.update(agent, fun(current_state)); | |
return Symbol.for('ok'); | |
})); | |
const __exports = { | |
get, | |
get_and_update, | |
start, | |
start_link, | |
stop, | |
update | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Agent').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Keyword = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__exports; | |
const to_char_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(atom) { | |
return to_string.split(''); | |
})); | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(atom) { | |
return Symbol.keyFor(atom); | |
})); | |
const __exports = { | |
to_char_list, | |
to_string | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Base').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Base').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Base').__exports; | |
const decode64 = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(data) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return Symbol.for('error'); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), decode64__emark__(data)); | |
})).call(this, Bootstrap.Core.can_decode64(data)); | |
})); | |
const decode64__emark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(data) { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core, 'get_global').atob(data); | |
})); | |
const encode64 = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(data) { | |
return Bootstrap.Core.b64EncodeUnicode(data); | |
})); | |
const __exports = { | |
decode64, | |
decode64__emark__, | |
encode64 | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Base').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Bitwise').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Bitwise').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Bitwise').__exports; | |
const __exports = {}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Bitwise').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable').__exports; | |
const Elixir$ElixirScript$Collectable$DefImpl = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl').__load(Elixir); | |
const Elixir$ElixirScript$Collectable = Bootstrap.Core.Functions.defprotocol({ | |
into: function() {} | |
}); | |
for (let {Type, Implementation} of Elixir$ElixirScript$Collectable$DefImpl) Bootstrap.Core.Functions.defimpl(Elixir$ElixirScript$Collectable, Type, Implementation) | |
const __exports = Elixir$ElixirScript$Collectable; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.List').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.List').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.List').__exports; | |
const into = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(original) { | |
return new Bootstrap.Core.Tuple(Object.freeze([]), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
})], function(list, x) { | |
return list.concat(Object.freeze([x])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Symbol.for('done')], function(list) { | |
return original.concat(list); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Symbol.for('halt')], function() { | |
return Symbol.for('ok'); | |
}))); | |
})); | |
const __exports = { | |
'Type': Array, | |
'Implementation': { | |
into | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.List').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.BitString').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.BitString').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.BitString').__exports; | |
const into = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(original) { | |
return new Bootstrap.Core.Tuple(original, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
})], function(acc, x) { | |
return new Bootstrap.Core.BitString(Bootstrap.Core.BitString.bitstring(acc), Bootstrap.Core.BitString.bitstring(x)); | |
}, function(acc, x) { | |
return Elixir$ElixirScript$Kernel.is_bitstring(x); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Symbol.for('done')], function(acc) { | |
return acc; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Symbol.for('halt')], function() { | |
return Symbol.for('ok'); | |
}))); | |
})); | |
const __exports = { | |
'Type': Bootstrap.Core.BitString, | |
'Implementation': { | |
into | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.BitString').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.Map').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.Map').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.Map').__exports; | |
const into = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(original) { | |
return new Bootstrap.Core.Tuple(original, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
})] | |
})], function(map, k, v) { | |
return Elixir$ElixirScript$Map.put(map, k, v); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Symbol.for('done')], function(map) { | |
return map; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Symbol.for('halt')], function() { | |
return Symbol.for('ok'); | |
}))); | |
})); | |
const __exports = { | |
'Type': Object, | |
'Implementation': { | |
into | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Collectable.DefImpl.Elixir.Map').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Map = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable').__exports; | |
const Elixir$ElixirScript$Enumerable$DefImpl = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl').__load(Elixir); | |
const Elixir$ElixirScript$Enumerable = Bootstrap.Core.Functions.defprotocol({ | |
reduce: function() {}, | |
member__qmark__: function() {}, | |
count: function() {} | |
}); | |
for (let {Type, Implementation} of Elixir$ElixirScript$Enumerable$DefImpl) Bootstrap.Core.Functions.defimpl(Elixir$ElixirScript$Enumerable, Type, Implementation) | |
const __exports = Elixir$ElixirScript$Enumerable; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.List').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.List').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.List').__exports; | |
const count = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return Elixir$ElixirScript$Kernel.length(list); | |
})); | |
const member__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, value) { | |
return Elixir.Enum.member__qmark__(list, value); | |
})); | |
const reduce = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('halt'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(acc, _fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('halted'), acc); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('suspend'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(list, acc, fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('suspended'), acc, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(__1) { | |
return reduce(list, __1, fun); | |
}))); | |
}), Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(acc, _fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('done'), acc); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.headTail(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(h, t, acc, fun) { | |
return reduce(t, fun(h, acc), fun); | |
})); | |
const __exports = { | |
'Type': Array, | |
'Implementation': { | |
count, | |
member__qmark__, | |
reduce | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.List').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.Map').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.Map').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.Map').__exports; | |
const do_reduce = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('halt'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(acc, _fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('halted'), acc); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('suspend'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(list, acc, fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('suspended'), acc, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(__1) { | |
return do_reduce(list, __1, fun); | |
}))); | |
}), Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(acc, _fun) { | |
return new Bootstrap.Core.Tuple(Symbol.for('done'), acc); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.headTail(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('cont'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.variable()], function(h, t, acc, fun) { | |
return do_reduce(t, fun(h, acc), fun); | |
})); | |
const count = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(map) { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), Elixir$ElixirScript$Kernel.map_size(map)); | |
})); | |
const member__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
})], function(map, key, value) { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.bound(value)], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return false; | |
})).call(this, Elixir$ElixirScript$Map.get(map, key))); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.wildcard()], function() { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), false); | |
})); | |
const reduce = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, acc, fun) { | |
return do_reduce(Elixir$ElixirScript$Map.to_list(map), acc, fun); | |
})); | |
const __exports = { | |
'Type': Object, | |
'Implementation': { | |
count, | |
member__qmark__, | |
reduce | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Enumerable.DefImpl.Elixir.Map').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Map = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Integer').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Integer').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Integer').__exports; | |
const is_even = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return number % 2 == 0; | |
})); | |
const is_odd = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return number % 2 != 0; | |
})); | |
const parse = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(bin) { | |
let [result] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Functions.call_property(Bootstrap.Core.Functions, 'get_global').parseInt(bin)); | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(index_of_dot) { | |
return new Bootstrap.Core.Tuple(result, ''); | |
}, function(index_of_dot) { | |
return index_of_dot < 0; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(index_of_dot) { | |
return new Bootstrap.Core.Tuple(result, bin.substring(index_of_dot)); | |
})).call(this, bin.indexOf('.')); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return Symbol.for('error'); | |
})).call(this, Bootstrap.Core.Functions.call_property(Bootstrap.Core.Functions, 'get_global').isNaN(result)); | |
})); | |
const to_char_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return to_char_list(number, 10); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(number, base) { | |
return number.toString(base).split(Object.freeze([])); | |
})); | |
const __exports = { | |
is_even, | |
is_odd, | |
parse, | |
to_char_list | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Integer').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.JS').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.JS').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.JS').__exports; | |
const global = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([], function() { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core.Functions, 'get_global'); | |
})); | |
const is_generator = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core.Functions.call_property(term, 'constructor'), 'name') === 'GeneratorFunction'; | |
})); | |
const __exports = { | |
global, | |
is_generator | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.JS').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__exports; | |
const build_if = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Object.freeze([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('do'), Bootstrap.Core.Patterns.variable()] | |
})])], function(condition, do_clause) { | |
return build_if(condition, Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('do'), do_clause), new Bootstrap.Core.Tuple(Symbol.for('else'), null)])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Object.freeze([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('do'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('else'), Bootstrap.Core.Patterns.variable()] | |
})])], function(condition, do_clause, else_clause) { | |
return new Bootstrap.Core.Tuple(Symbol.for('case'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 19)]), Object.freeze([condition, Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('do'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('->'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 20)]), Object.freeze([Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('when'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 20)]), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('x'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 20)]), null), new Bootstrap.Core.Tuple(Symbol.for('in'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 20)]), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('x'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 20)]), null), Object.freeze([false, null])]))]))]), else_clause])), new Bootstrap.Core.Tuple(Symbol.for('->'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 22)]), Object.freeze([Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('_'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 22)]), null)]), do_clause]))]))])])); | |
})); | |
const build_unless = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Object.freeze([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('do'), Bootstrap.Core.Patterns.variable()] | |
})])], function(condition, do_clause) { | |
return build_unless(condition, Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('do'), do_clause), new Bootstrap.Core.Tuple(Symbol.for('else'), null)])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Object.freeze([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('do'), Bootstrap.Core.Patterns.variable()] | |
}), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Symbol.for('else'), Bootstrap.Core.Patterns.variable()] | |
})])], function(condition, do_clause, else_clause) { | |
return new Bootstrap.Core.Tuple(Symbol.for('if'), Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('line'), 38)]), Object.freeze([condition, Object.freeze([new Bootstrap.Core.Tuple(Symbol.for('do'), else_clause), new Bootstrap.Core.Tuple(Symbol.for('else'), do_clause)])])); | |
})); | |
const abs = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return Math.abs(number); | |
})); | |
const apply = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(fun, args) { | |
return Bootstrap.Core.Functions.apply(fun, args); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(module, fun, args) { | |
return Bootstrap.Core.Functions.apply(module, Elixir$ElixirScript$Atom.to_string(fun), args); | |
})); | |
const binary_part = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(binary, start, len) { | |
return binary.substring(start, len); | |
})); | |
const elem = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, index) { | |
return Bootstrap.Core.Functions.apply(tuple, 'get', Object.freeze([index])); | |
})); | |
const hd = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return list[0]; | |
})); | |
const is_atom = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return typeof term === 'symbol'; | |
})); | |
const is_binary = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return typeof term === 'string'; | |
})); | |
const is_bitstring = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return is_binary(term) || term instanceof Bootstrap.Core.BitString; | |
})); | |
const is_boolean = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return typeof term === 'boolean' || term instanceof Boolean; | |
})); | |
const is_float = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return is_number(term) && !Number.isInteger(term); | |
})); | |
const is_function = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return is_function(term, 0); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.wildcard()], function(term) { | |
return typeof term === 'function' || term instanceof Function; | |
})); | |
const is_integer = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Number.isInteger(term); | |
})); | |
const is_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Array.isArray(term); | |
})); | |
const is_map = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return typeof term === 'object' || term instanceof Object; | |
})); | |
const is_nil = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return term === null; | |
})); | |
const is_number = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return typeof term === 'number' || term instanceof Number; | |
})); | |
const is_pid = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return term instanceof Bootstrap.Core.PID; | |
})); | |
const is_port = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return false; | |
})); | |
const is_reference = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return false; | |
})); | |
const is_tuple = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return term instanceof Bootstrap.Core.Tuple; | |
})); | |
const length = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Bootstrap.Core.Functions.call_property(term, 'length'); | |
})); | |
const map_size = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Bootstrap.Core.Functions.call_property(Object.keys(term), 'length'); | |
})); | |
const max = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(first, second) { | |
return Math.max(first, second); | |
})); | |
const min = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(first, second) { | |
return Math.min(first, second); | |
})); | |
const round = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return Math.round(number); | |
})); | |
const tl = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return list.slice(1); | |
})); | |
const trunc = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(number) { | |
return Math.floor(number); | |
})); | |
const tuple_size = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(tuple) { | |
return Bootstrap.Core.Functions.size(tuple); | |
})); | |
const __exports = { | |
abs, | |
apply, | |
binary_part, | |
elem, | |
hd, | |
is_atom, | |
is_binary, | |
is_bitstring, | |
is_boolean, | |
is_float, | |
is_function, | |
is_integer, | |
is_list, | |
is_map, | |
is_nil, | |
is_number, | |
is_pid, | |
is_port, | |
is_reference, | |
is_tuple, | |
length, | |
map_size, | |
max, | |
min, | |
round, | |
tl, | |
trunc, | |
tuple_size | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__exports = __exports | |
const Elixir$ElixirScript$Atom = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__exports; | |
const do_get = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(kw, key) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
})], function(kw_key, value) { | |
return value; | |
}, function(kw_key, value) { | |
return kw_key == key; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return do_get(Elixir$ElixirScript$Kernel.tl(kw), key); | |
})).call(this, Elixir$ElixirScript$Kernel.hd(kw)); | |
})); | |
const do_has_key__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard()], function() { | |
return false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(kw, key) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.wildcard()] | |
})], function(the_key) { | |
return true; | |
}, function(the_key) { | |
return the_key == key; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return do_has_key__qmark__(Elixir$ElixirScript$Kernel.tl(kw), key); | |
})).call(this, Elixir$ElixirScript$Kernel.hd(kw)); | |
})); | |
const get = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(kw, key) { | |
return get(kw, key, null); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(kw, key, default_value) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return do_get(kw, key); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return default_value; | |
})).call(this, has_key__qmark__(kw, key)); | |
})); | |
const has_key__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(kw, key) { | |
return do_has_key__qmark__(kw, key); | |
})); | |
const __exports = { | |
get, | |
has_key__qmark__ | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.List').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.List').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.List').__exports; | |
const do_delete = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, item, current_index, new_list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.bound(item)], function() { | |
return new_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([list[current_index]])); | |
})).call(this, list[current_index])); | |
return do_delete(list, item, current_index + 1, updated); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(list)); | |
})); | |
const do_delete_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, current_index, new_list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([list[current_index]])); | |
})).call(this, current_index == index)); | |
return do_delete_at(list, index, current_index + 1, updated); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(list)); | |
})); | |
const do_duplicate = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), 0, Bootstrap.Core.Patterns.variable()], function(list) { | |
return list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(data, size, list) { | |
return do_duplicate(data, size - 1, list.concat(Object.freeze([data]))); | |
})); | |
const do_flatten = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.variable()], function(flattened_list) { | |
return flattened_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, flattened_list) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(l) { | |
return flattened_list.concat(do_flatten(l, Object.freeze([]))); | |
}, function(l) { | |
return Elixir$ElixirScript$Kernel.is_list(l); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(item) { | |
return flattened_list.concat(Object.freeze([item])); | |
})).call(this, Elixir$ElixirScript$Kernel.hd(list))); | |
return do_flatten(Elixir$ElixirScript$Kernel.tl(list), updated); | |
})); | |
const do_foldl = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()], function(acc, new_list) { | |
return new Bootstrap.Core.Tuple(acc, new_list); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, acc, func, new_list) { | |
let [acc1, value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
}), func(Elixir$ElixirScript$Kernel.hd(list), acc)); | |
let _ref = new Bootstrap.Core.Tuple(acc1, value); | |
return do_foldl(Elixir$ElixirScript$Kernel.tl(list), acc, func, new_list.concat(Object.freeze([value]))); | |
})); | |
const do_insert_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, value, current_index, new_list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new_list.concat(Object.freeze([value, list[current_index]])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([list[current_index]])); | |
})).call(this, current_index == index)); | |
return do_insert_at(list, index, value, current_index + 1, updated); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(list)); | |
})); | |
const do_keydelete = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()], function(new_list) { | |
return new_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position, new_list) { | |
let [current_value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(list)); | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return new_list.concat(Object.freeze([current_value])); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, Elixir$ElixirScript$Kernel.elem(current_value, position) == key)); | |
return do_keydelete(Elixir$ElixirScript$Kernel.tl(list), key, position, updated); | |
})); | |
const do_keyfind = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()], function(__default__) { | |
return __default__; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position, __default__) { | |
let [current_value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(list)); | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return do_keyfind(Elixir$ElixirScript$Kernel.tl(list), key, position, __default__); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return current_value; | |
})).call(this, Elixir$ElixirScript$Kernel.elem(current_value, position) == key); | |
})); | |
const do_keyreplace = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.wildcard()], function(new_list) { | |
return new_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position, new_list, new_tuple) { | |
let [current_value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(list)); | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return new_list.concat(Object.freeze([current_value])); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([new_tuple])); | |
})).call(this, Elixir$ElixirScript$Kernel.elem(current_value, position) == key)); | |
return do_keyreplace(Elixir$ElixirScript$Kernel.tl(list), key, position, updated, new_tuple); | |
})); | |
const do_replace_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, value, current_index, new_list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new_list.concat(Object.freeze([value])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([list[current_index]])); | |
})).call(this, current_index == index)); | |
return do_replace_at(list, index, value, current_index + 1, updated); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(list)); | |
})); | |
const do_update_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, func, current_index, new_list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [updated] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new_list.concat(Object.freeze([func(list[current_index])])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list.concat(Object.freeze([list[current_index]])); | |
})).call(this, current_index == index)); | |
return do_update_at(list, index, func, current_index + 1, updated); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return new_list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(list)); | |
})); | |
const append = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, term) { | |
return concat(list, Object.freeze([term])); | |
})); | |
const concat = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list_a, list_b) { | |
return list_a.concat(list_b); | |
})); | |
const __delete__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, item) { | |
return do_delete(list, item, 0, Object.freeze([])); | |
})); | |
const delete_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index) { | |
return do_delete_at(list, index, 0, Object.freeze([])); | |
})); | |
const duplicate = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(data, size) { | |
return do_duplicate(data, size, Object.freeze([])); | |
})); | |
const first = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return list[0]; | |
})); | |
const flatten = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return do_flatten(list, Object.freeze([])); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, tail) { | |
return do_flatten.concat(tail); | |
})); | |
const foldl = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, acc, func) { | |
return do_foldl(list, acc, func, Object.freeze([])); | |
})); | |
const foldr = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, acc, func) { | |
return do_foldl(Bootstrap.Core.Functions.call_property(list.concat(Object.freeze([])), 'reverse'), acc, func, Object.freeze([])); | |
})); | |
const insert_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, value) { | |
return do_insert_at(list, index, value, 0, Object.freeze([])); | |
})); | |
const keydelete = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position) { | |
return do_keydelete(list, key, position, Object.freeze([])); | |
})); | |
const keyfind = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position) { | |
return do_keyfind(list, key, position, null); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position, __default__) { | |
return do_keyfind(list, key, position, __default__); | |
})); | |
const keymember__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position) { | |
return keyfind(list, key, position) != null; | |
})); | |
const keyreplace = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, key, position, new_tuple) { | |
return do_keyreplace(list, key, position, Object.freeze([]), new_tuple); | |
})); | |
const last = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return list[Elixir$ElixirScript$Kernel.length(list) - 1]; | |
})); | |
const prepend = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, term) { | |
return concat(Object.freeze([term]), list); | |
})); | |
const replace_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, value) { | |
return do_replace_at(list, index, value, 0, Object.freeze([])); | |
})); | |
const to_tuple = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return new Bootstrap.Core.Tuple(...list); | |
})); | |
const update_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(list, index, func) { | |
return do_update_at(list, index, func, 0, Object.freeze([])); | |
})); | |
const wrap = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return list; | |
}, function(list) { | |
return Elixir$ElixirScript$Kernel.is_list(list); | |
}), Bootstrap.Core.Patterns.clause([null], function() { | |
return Object.freeze([]); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return Object.freeze([term]); | |
})); | |
const zip = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list_of_lists) { | |
return Bootstrap.Core.Functions.zip(list_of_lists); | |
})); | |
const __exports = { | |
append, | |
concat, | |
__delete__, | |
delete_at, | |
duplicate, | |
first, | |
flatten, | |
foldl, | |
foldr, | |
insert_at, | |
keydelete, | |
keyfind, | |
keymember__qmark__, | |
keyreplace, | |
last, | |
prepend, | |
replace_at, | |
to_tuple, | |
update_at, | |
wrap, | |
zip | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.List').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Macro.Env').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Macro.Env').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Macro.Env').__exports; | |
const Elixir$ElixirScript$Macro$Env = Bootstrap.Core.Functions.defstruct({ | |
[Symbol.for('__struct__')]: Symbol.for('Elixir.ElixirScript.Macro.Env'), | |
[Symbol.for('module')]: null, | |
[Symbol.for('file')]: null, | |
[Symbol.for('line')]: 0, | |
[Symbol.for('function')]: null, | |
[Symbol.for('context')]: null, | |
[Symbol.for('aliases')]: Object.freeze([]), | |
[Symbol.for('requires')]: Object.freeze([]), | |
[Symbol.for('functions')]: Object.freeze([]), | |
[Symbol.for('macros')]: Object.freeze([]), | |
[Symbol.for('macro_aliases')]: Object.freeze([]), | |
[Symbol.for('context_modules')]: Object.freeze([]), | |
[Symbol.for('vars')]: Object.freeze([]), | |
[Symbol.for('export_vars')]: null, | |
[Symbol.for('lexical_tracker')]: null | |
}); | |
const __exports = { | |
Elixir$ElixirScript$Macro$Env | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Macro.Env').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__exports; | |
const do_split = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Object.freeze([]), Bootstrap.Core.Patterns.variable()], function(split_tuple) { | |
return split_tuple; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()] | |
})], function(map, keys, key_map, non_key_map) { | |
let [key] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(keys)); | |
let [new_split_tuple] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new Bootstrap.Core.Tuple(Elixir$ElixirScript$Map.put(key_map, key, map[key]), non_key_map); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return new Bootstrap.Core.Tuple(key_map, Elixir$ElixirScript$Map.put(non_key_map, key, map[key])); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key))); | |
return do_split(map, Elixir$ElixirScript$Kernel.tl(keys), new_split_tuple); | |
})); | |
const __delete__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return Bootstrap.Core.Functions.delete_property_from_map(map, key); | |
})); | |
const do_to_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([0], function() { | |
return list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
let [key] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(keys(map))); | |
let [value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), map[key]); | |
return do_to_list(Elixir$ElixirScript$Map.__delete__(map, key), list.concat(Object.freeze([new Bootstrap.Core.Tuple(key, value)]))); | |
})).call(this, size(map)); | |
})); | |
const drop = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, keys) { | |
let [undefined, non_key_map] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()] | |
}), split(map, keys)); | |
let _ref = new Bootstrap.Core.Tuple(undefined, non_key_map); | |
return non_key_map; | |
})); | |
const equal__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map1, map2) { | |
return map1 === map2; | |
})); | |
const fetch = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), map[key]); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return Symbol.for('error'); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const fetch__emark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return map[key]; | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
throw { | |
[Symbol.for('__struct__')]: Symbol.for('RuntimeError'), | |
[Symbol.for('__exception__')]: true, | |
[Symbol.for('message')]: Elixir$ElixirScript$String$Chars.to_string(key) + ' not found in map' | |
}; | |
return null; | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const from_struct = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(struct) { | |
return __delete__(Bootstrap.Core.Functions.class_to_obj(struct), Symbol.for('__struct__')); | |
})); | |
const get = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return get(map, key, null); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, default_value) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return map[key]; | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return default_value; | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const get_and_update = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new Bootstrap.Core.Tuple(null, map); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
let [new_value] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), func(map[key])); | |
return new Bootstrap.Core.Tuple(new_value, Elixir$ElixirScript$Map.put(map, key, new_value)); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const get_lazy = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return func(map[key]); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return func(); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const has_key__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return Elixir.Enum.member__qmark__(keys(map), key); | |
})); | |
const keys = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(map) { | |
return Bootstrap.Core.Functions.get_object_keys(map); | |
})); | |
const merge = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map1, map2) { | |
return Bootstrap.Core.SpecialForms.map_update(map1, map2); | |
})); | |
const __new__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([], function() { | |
return Object.freeze({}); | |
})); | |
const pop = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key) { | |
return pop(map, key, null); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, default_value) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new Bootstrap.Core.Tuple(map[key], Elixir$ElixirScript$Map.__delete__(map, key)); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return new Bootstrap.Core.Tuple(default_value, map); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const pop_lazy = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return new Bootstrap.Core.Tuple(func(map[key]), Elixir$ElixirScript$Map.__delete__(map, key)); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return new Bootstrap.Core.Tuple(func(), map); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const put = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, value) { | |
return Bootstrap.Core.Functions.add_property_to_map(map, key, value); | |
})); | |
const put_new = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, value) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return map; | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return Elixir$ElixirScript$Map.put(map, key, value); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const put_new_lazy = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return map; | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return Elixir$ElixirScript$Map.put(map, key, func()); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const size = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(map) { | |
return Bootstrap.Core.Functions.call_property(keys, 'length'); | |
})); | |
const split = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, keys) { | |
return do_split(map, keys, new Bootstrap.Core.Tuple(Object.freeze({}), Object.freeze({}))); | |
})); | |
const take = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, keys) { | |
let [key_map, undefined] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.type(Bootstrap.Core.Tuple, { | |
values: [Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.wildcard()] | |
}), split(map, keys)); | |
let _ref = new Bootstrap.Core.Tuple(key_map, undefined); | |
return key_map; | |
})); | |
const to_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(map) { | |
return do_to_list(map, Object.freeze([])); | |
})); | |
const update = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, initial, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return Elixir$ElixirScript$Map.put(map, key, func(map[key])); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return Elixir$ElixirScript$Map.put(map, key, initial); | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const update__emark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(map, key, func) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return Elixir$ElixirScript$Map.put(map, key, func(map[key])); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
throw { | |
[Symbol.for('__struct__')]: Symbol.for('RuntimeError'), | |
[Symbol.for('__exception__')]: true, | |
[Symbol.for('message')]: Elixir$ElixirScript$String$Chars.to_string(key) + ' not found in map' | |
}; | |
return null; | |
})).call(this, Elixir.Enum.member__qmark__(keys(map), key)); | |
})); | |
const values = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(map) { | |
return Object.values(map); | |
})); | |
const __exports = { | |
__delete__, | |
do_to_list, | |
drop, | |
equal__qmark__, | |
fetch, | |
fetch__emark__, | |
from_struct, | |
get, | |
get_and_update, | |
get_lazy, | |
has_key__qmark__, | |
keys, | |
merge, | |
__new__, | |
pop, | |
pop_lazy, | |
put, | |
put_new, | |
put_new_lazy, | |
size, | |
split, | |
take, | |
to_list, | |
update, | |
update__emark__, | |
values | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.MapSet').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.MapSet').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.MapSet').__exports; | |
const Elixir$ElixirScript$MapSet = Bootstrap.Core.Functions.defstruct({ | |
[Symbol.for('__struct__')]: Symbol.for('Elixir.ElixirScript.MapSet'), | |
[Symbol.for('set')]: Object.freeze([]) | |
}); | |
const __delete__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set, term) { | |
return Bootstrap.Core.SpecialForms.map_update(set, Object.freeze({ | |
[Symbol.for('set')]: Elixir$ElixirScript$List.remove(Bootstrap.Core.Functions.call_property(set, 'set'), term) | |
})); | |
})); | |
const difference = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return do_difference(to_list(set1), set2, __new__()); | |
})); | |
const disjoint__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return size(intersection(set1, set2)) == 0; | |
})); | |
const do_difference = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()], function(difference_set) { | |
return difference_set; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1_list, set2, difference_set) { | |
let [term] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(set1_list)); | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return do_difference(Elixir$ElixirScript$Kernel.tl(set1_list), set2, difference_set); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return do_difference(Elixir$ElixirScript$Kernel.tl(set1_list), set2, Bootstrap.Core.SpecialForms.map_update(difference_set, Object.freeze({ | |
[Symbol.for('set')]: Bootstrap.Core.Functions.call_property(difference_set, 'set').concat(Object.freeze([term])) | |
}))); | |
})).call(this, member__qmark__(set2, term)); | |
})); | |
const do_intersection = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard(), Bootstrap.Core.Patterns.variable()], function(intersection_set) { | |
return intersection_set; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1_list, set2, intersection_set) { | |
let [term] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(set1_list)); | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([false], function() { | |
return do_intersection(Elixir$ElixirScript$Kernel.tl(set1_list), set2, intersection_set); | |
}), Bootstrap.Core.Patterns.clause([true], function() { | |
return do_intersection(Elixir$ElixirScript$Kernel.tl(set1_list), set2, Bootstrap.Core.SpecialForms.map_update(intersection_set, Object.freeze({ | |
[Symbol.for('set')]: Bootstrap.Core.Functions.call_property(intersection_set, 'set').concat(Object.freeze([term])) | |
}))); | |
})).call(this, member__qmark__(set2, term)); | |
})); | |
const do_subset__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Object.freeze([]), Bootstrap.Core.Patterns.wildcard()], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1_list, set2) { | |
let [term] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Kernel.hd(set1_list)); | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([false], function() { | |
return false; | |
}), Bootstrap.Core.Patterns.clause([true], function() { | |
return do_subset__qmark__(Elixir$ElixirScript$Kernel.tl(set1_list), set2); | |
})).call(this, member__qmark__(set2, term)); | |
})); | |
const equal__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return set1 === set2; | |
})); | |
const intersection = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return do_intersection(to_list(set1), set2, __new__()); | |
})); | |
const member__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set, term) { | |
return Bootstrap.Core.Functions.call_property(set, 'set').indexOf(term) >= 0; | |
})); | |
const __new__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([], function() { | |
return Elixir$ElixirScript$MapSet.Elixir$ElixirScript$MapSet.create(Object.freeze({})); | |
})); | |
const put = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set, term) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([false], function() { | |
return Bootstrap.Core.SpecialForms.map_update(set, Object.freeze({ | |
[Symbol.for('set')]: Bootstrap.Core.Functions.call_property(set, 'set').concat(term) | |
})); | |
}), Bootstrap.Core.Patterns.clause([true], function() { | |
return set; | |
})).call(this, member__qmark__(set, term)); | |
})); | |
const size = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(set) { | |
return Elixir$ElixirScript$Kernel.length(Bootstrap.Core.Functions.call_property(set, 'set')); | |
})); | |
const subset__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return do_subset__qmark__(to_list(set1), set2); | |
})); | |
const to_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(set) { | |
return Bootstrap.Core.Functions.call_property(set, 'set'); | |
})); | |
const union = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(set1, set2) { | |
return Bootstrap.Core.SpecialForms.map_update(set1, Object.freeze({ | |
[Symbol.for('set')]: Bootstrap.Core.Functions.call_property(set1, 'set').concat(Bootstrap.Core.Functions.call_property(set2, 'set')) | |
})); | |
})); | |
const __exports = { | |
Elixir$ElixirScript$MapSet, | |
__delete__, | |
difference, | |
disjoint__qmark__, | |
do_difference, | |
do_intersection, | |
do_subset__qmark__, | |
equal__qmark__, | |
intersection, | |
member__qmark__, | |
__new__, | |
put, | |
size, | |
subset__qmark__, | |
to_list, | |
union | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.MapSet').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$List = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.List').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Module').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Module').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Module').__exports; | |
const Elixir$ElixirScript$Module = Bootstrap.Core.Functions.defstruct({ | |
[Symbol.for('__struct__')]: Symbol.for('Elixir.ElixirScript.Module'), | |
[Symbol.for('name')]: null, | |
[Symbol.for('functions')]: Bootstrap.Core.Functions.call_property(Elixir$ElixirScript$Keyword, 'new'), | |
[Symbol.for('private_functions')]: Bootstrap.Core.Functions.call_property(Elixir$ElixirScript$Keyword, 'new'), | |
[Symbol.for('body')]: null, | |
[Symbol.for('js_imports')]: Object.freeze([]), | |
[Symbol.for('module_refs')]: Object.freeze([]), | |
[Symbol.for('type')]: Symbol.for('module'), | |
[Symbol.for('impls')]: Bootstrap.Core.Functions.call_property(Elixir$ElixirScript$Map, 'new'), | |
[Symbol.for('impl_type')]: null, | |
[Symbol.for('app_name')]: null | |
}); | |
const __exports = { | |
Elixir$ElixirScript$Module | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Module').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Keyword = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__load(Elixir); | |
const Elixir$ElixirScript$Map = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Map').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Range').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Range').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Range').__exports; | |
const Elixir$ElixirScript$Range = Bootstrap.Core.Functions.defstruct({ | |
[Symbol.for('__struct__')]: Symbol.for('Elixir.ElixirScript.Range'), | |
[Symbol.for('first')]: null, | |
[Symbol.for('last')]: null | |
}); | |
const __new__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(first, last) { | |
return Elixir$ElixirScript$Range.Elixir$ElixirScript$Range.create(Object.freeze({ | |
[Symbol.for('first')]: first, | |
[Symbol.for('last')]: last | |
})); | |
})); | |
const range__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.type(Elixir$ElixirScript$Range.Elixir$ElixirScript$Range, {})], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return false; | |
})); | |
const __exports = { | |
Elixir$ElixirScript$Range, | |
__new__, | |
range__qmark__ | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Range').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Regex').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Regex').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Regex').__exports; | |
const do_scan = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(regex, string, options, results) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return results; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(match) { | |
return do_scan(regex, string, options, results.concat(match)); | |
})).call(this, run(regex, string, options)); | |
})); | |
const make_global = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(regex) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return new RegExp(source(regex), opts(regex) + 'g'); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return regex; | |
})).call(this, Elixir$ElixirScript$String.contains__qmark__(opts(regex), 'g')); | |
})); | |
const compile = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable('')], function(source, options) { | |
return Bootstrap.Core.SpecialForms._try(function() { | |
return new Bootstrap.Core.Tuple(Symbol.for('ok'), new RegExp(source, options)); | |
}, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return new Bootstrap.Core.Tuple(Symbol.for('error'), Bootstrap.Core.Functions.call_property(x, 'message')); | |
})), null, null, null); | |
})); | |
const compile__emark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable('')], function(source, options) { | |
return new RegExp(source, options); | |
})); | |
const match__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(regex, string) { | |
let [reg] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return compile__emark__(source(regex), opts(regex)); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return regex; | |
})).call(this, regex__qmark__(regex))); | |
return reg.test(string); | |
})); | |
const opts = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(regex) { | |
return Bootstrap.Core.Functions.call_property(regex, 'opts'); | |
})); | |
const regex__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(term) { | |
return term instanceof RegExp; | |
})); | |
const replace = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(regex, string, replacement, options) { | |
let [reg] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return regex; | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return make_global(regex); | |
})).call(this, Elixir$ElixirScript$Keyword.get(options, Symbol.for('global'), true))); | |
return string.replace(reg, replacement); | |
})); | |
const run = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(regex, string, options) { | |
return regex.exec(string); | |
})); | |
const scan = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(regex, string, options) { | |
let [reg] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), make_global(regex)); | |
return do_scan(reg, string, options, Object.freeze([])); | |
})); | |
const source = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(regex) { | |
return Bootstrap.Core.Functions.call_property(regex, 'source'); | |
})); | |
const __exports = { | |
compile, | |
compile__emark__, | |
match__qmark__, | |
opts, | |
regex__qmark__, | |
replace, | |
run, | |
scan, | |
source | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Regex').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Keyword = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__load(Elixir); | |
const Elixir$ElixirScript$String = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String').__exports; | |
const do_reverse = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause(['', Bootstrap.Core.Patterns.variable()], function(str) { | |
return str; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, reverse_str) { | |
return do_reverse(str.substr(1), reverse_str + last(str)); | |
})); | |
const at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, pos) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return str[pos]; | |
})).call(this, pos > length(str)); | |
})); | |
const capitalize = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
let [first] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Functions.call_property(str[0], 'toUpperCase')); | |
let [rest] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Functions.call_property(str.substr(1), 'toLowerCase')); | |
return first + rest; | |
})); | |
const codepoints = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return do_codepoints(str, Object.freeze([])); | |
})); | |
const contains__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, s) { | |
return str.indexOf(s) > -1; | |
}, function(str, s) { | |
return Elixir$ElixirScript$Kernel.is_binary(s); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, s) { | |
return do_contains__qmark__(str, s); | |
}, function(str, s) { | |
return Elixir$ElixirScript$Kernel.is_list(s); | |
})); | |
const do_codepoints = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause(['', Bootstrap.Core.Patterns.variable()], function(codepoint_list) { | |
return codepoint_list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, codepoint_list) { | |
return do_codepoints(str.substr(1), codepoint_list.concat(Object.freeze([first.codePointAt(0)]))); | |
})); | |
const do_contains__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Object.freeze([])], function() { | |
return false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, prefixes) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return do_contains__qmark__(str, Elixir$ElixirScript$Kernel.tl(prefixes)); | |
})).call(this, contains__qmark__(str, Elixir$ElixirScript$Kernel.hd(prefixes))); | |
})); | |
const do_ends_with__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Object.freeze([])], function() { | |
return false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, suffixes) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return do_ends_with__qmark__(str, Elixir$ElixirScript$Kernel.tl(suffixes)); | |
})).call(this, ends_with__qmark__(str, Elixir$ElixirScript$Kernel.hd(suffixes))); | |
})); | |
const do_starts_with__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), Object.freeze([])], function() { | |
return false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, prefixes) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return true; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return do_starts_with__qmark__(str, Elixir$ElixirScript$Kernel.tl(prefixes)); | |
})).call(this, starts_with__qmark__(str, Elixir$ElixirScript$Kernel.hd(prefixes))); | |
})); | |
const downcase = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(str, 'toLowerCase'); | |
})); | |
const duplicate = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, n) { | |
return str.repeat(n); | |
})); | |
const ends_with__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, suffix) { | |
return str.endsWith(suffix); | |
}, function(str, suffix) { | |
return Elixir$ElixirScript$Kernel.is_binary(suffix); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, suffixes) { | |
return do_ends_with__qmark__(str, suffixes); | |
}, function(str, suffixes) { | |
return Elixir$ElixirScript$Kernel.is_list(suffixes); | |
})); | |
const first = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return str[0]; | |
})); | |
const graphemes = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return str.split(Object.freeze([])); | |
})); | |
const last = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return str[length(str) - 1]; | |
})); | |
const length = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(str, 'length'); | |
})); | |
const match__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, regex) { | |
return str.match(regex) != null; | |
})); | |
const next_codepoint = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([''], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return new Bootstrap.Core.Tuple(str[0].codePointAt(0), str.substr(1)); | |
})); | |
const next_grapheme = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([''], function() { | |
return null; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return new Bootstrap.Core.Tuple(str[0], str.substr(1)); | |
})); | |
const reverse = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return do_reverse(str, ''); | |
})); | |
const split = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(str, 'split'); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(Object.freeze([]))], function(str, replace, options) { | |
let [limit] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Keyword.get(options, Symbol.for('parts'), -1)); | |
let [trim] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Elixir$ElixirScript$Keyword.get(options, Symbol.for('trim'), false)); | |
let [split] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), str.split(replace, limit)); | |
return Bootstrap.Enum.map(split, Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
return x; | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return Bootstrap.Core.Functions.call_property(x, 'trim'); | |
})).call(this, trim); | |
}))); | |
})); | |
const starts_with__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, prefix) { | |
return str.startsWith(prefix); | |
}, function(str, prefix) { | |
return Elixir$ElixirScript$Kernel.is_binary(prefix); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, prefixes) { | |
return do_starts_with__qmark__(str, prefixes); | |
}, function(str, prefixes) { | |
return Elixir$ElixirScript$Kernel.is_list(prefixes); | |
})); | |
const to_atom = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Symbol.for(str); | |
})); | |
const to_char_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return str.split(''); | |
})); | |
const to_existing_atom = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Symbol.for(str); | |
})); | |
const to_float = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core, 'get_global').parseFloat(str); | |
})); | |
const to_integer = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core, 'get_global').parseInt(str, 10); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(str, base) { | |
return Bootstrap.Core.Functions.call_property(Bootstrap.Core, 'get_global').parseInt(str, base); | |
})); | |
const upcase = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(str) { | |
return Bootstrap.Core.Functions.call_property(str, 'toUpperCase'); | |
})); | |
const valid_character__qmark__ = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(codepoint) { | |
return Bootstrap.Core.Functions.is_valid_character(codepoint); | |
})); | |
const __exports = { | |
at, | |
capitalize, | |
codepoints, | |
contains__qmark__, | |
do_codepoints, | |
do_contains__qmark__, | |
do_ends_with__qmark__, | |
do_starts_with__qmark__, | |
downcase, | |
duplicate, | |
ends_with__qmark__, | |
first, | |
graphemes, | |
last, | |
length, | |
match__qmark__, | |
next_codepoint, | |
next_grapheme, | |
reverse, | |
split, | |
starts_with__qmark__, | |
to_atom, | |
to_char_list, | |
to_existing_atom, | |
to_float, | |
to_integer, | |
upcase, | |
valid_character__qmark__ | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Keyword = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Keyword').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars').__exports; | |
const Elixir$ElixirScript$String$Chars$DefImpl = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl').__load(Elixir); | |
const Elixir$ElixirScript$String$Chars = Bootstrap.Core.Functions.defprotocol({ | |
to_string: function() {} | |
}); | |
for (let {Type, Implementation} of Elixir$ElixirScript$String$Chars$DefImpl) Bootstrap.Core.Functions.defimpl(Elixir$ElixirScript$String$Chars, Type, Implementation) | |
const __exports = Elixir$ElixirScript$String$Chars; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Atom').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Atom').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Atom').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([null], function() { | |
return ''; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(atom) { | |
return Elixir$ElixirScript$Atom.to_string(atom); | |
})); | |
const __exports = { | |
'Type': Symbol, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Atom').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
const Elixir$ElixirScript$Atom = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Atom').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.BitString').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.BitString').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.BitString').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(thing) { | |
return thing; | |
}, function(thing) { | |
return Elixir$ElixirScript$Kernel.is_binary(thing); | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(thing) { | |
return Bootstrap.Core.Functions.call_property(thing, 'toString'); | |
})); | |
const __exports = { | |
'Type': Bootstrap.Core.BitString, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.BitString').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.List').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.List').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.List').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(list) { | |
return Bootstrap.Core.Functions.call_property(list, 'toString'); | |
})); | |
const __exports = { | |
'Type': Array, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.List').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Tuple').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Tuple').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Tuple').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(tuple) { | |
return Bootstrap.Core.Functions.call_property(tuple, 'toString'); | |
})); | |
const __exports = { | |
'Type': Bootstrap.Core.Tuple, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Tuple').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Integer').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Integer').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Integer').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(integer) { | |
return Bootstrap.Core.Functions.call_property(integer, 'toString'); | |
})); | |
const __exports = { | |
'Type': Bootstrap.Core.Integer, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Integer').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Float').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Float').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Float').__exports; | |
const to_string = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(float) { | |
return Bootstrap.Core.Functions.call_property(float, 'toString'); | |
})); | |
const __exports = { | |
'Type': Bootstrap.Core.Float, | |
'Implementation': { | |
to_string | |
} | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.String.Chars.DefImpl.Elixir.Float').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Tuple').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Tuple').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Tuple').__exports; | |
const do_delete_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, index, current_index, list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [list] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return list; | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return list.concat(Object.freeze([tuple.get(current_index)])); | |
})).call(this, index == current_index)); | |
return do_delete_at(tuple, index, current_index + 1, list); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(tuple)); | |
})); | |
const do_duplicate = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard(), 0, Bootstrap.Core.Patterns.variable()], function(list) { | |
return list; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(data, size, list) { | |
return do_duplicate(data, size - 1, list.concat(Object.freeze([data]))); | |
})); | |
const do_insert_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, index, value, current_index, list) { | |
return Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(x) { | |
let [list] = Bootstrap.Core.Patterns.match(Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([true], function() { | |
return list.concat(Object.freeze([value, tuple.get(current_index)])); | |
}), Bootstrap.Core.Patterns.clause([false], function() { | |
return list.concat(Object.freeze([tuple.get(current_index)])); | |
})).call(this, index == current_index)); | |
return do_insert_at(tuple, index, value, current_index + 1, list); | |
}, function(x) { | |
return x === null || x === false; | |
}), Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.wildcard()], function() { | |
return list; | |
})).call(this, current_index == Elixir$ElixirScript$Kernel.length(tuple)); | |
})); | |
const append = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, value) { | |
return new Bootstrap.Core.Tuple(...to_list.concat(Object.freeze([value]))); | |
})); | |
const delete_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, index) { | |
return new Bootstrap.Core.Tuple(...do_delete_at(tuple, index, 0, Object.freeze([]))); | |
})); | |
const duplicate = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(data, size) { | |
return new Bootstrap.Core.Tuple(...do_duplicate(data, size, Object.freeze([]))); | |
})); | |
const insert_at = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable(), Bootstrap.Core.Patterns.variable()], function(tuple, index, value) { | |
return new Bootstrap.Core.Tuple(...do_insert_at(tuple, index, value, 0, Object.freeze([]))); | |
})); | |
const to_list = Bootstrap.Core.Patterns.defmatch(Bootstrap.Core.Patterns.clause([Bootstrap.Core.Patterns.variable()], function(tuple) { | |
return tuple['value']; | |
})); | |
const __exports = { | |
append, | |
delete_at, | |
duplicate, | |
insert_at, | |
to_list | |
}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Tuple').__exports = __exports | |
const Elixir$ElixirScript$Kernel = Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Kernel').__load(Elixir); | |
return __exports; | |
} | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Temp').__load = function(Elixir) { | |
if (Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Temp').__exports) | |
return Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Temp').__exports; | |
console.log('test') | |
const __exports = {}; | |
Bootstrap.Core.Functions.build_namespace(Elixir, 'Elixir.ElixirScript.Temp').__exports = __exports | |
return __exports; | |
} | |
export default Elixir; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment