mirror of
https://github.com/urbit/shrub.git
synced 2024-12-17 07:14:52 +03:00
Merge commit 'bd8c09' into HEAD
This commit is contained in:
commit
45c9ee7b15
@ -3,8 +3,6 @@
|
||||
*/
|
||||
#include "all.h"
|
||||
|
||||
|
||||
|
||||
/* internals
|
||||
*/
|
||||
static u3_noun
|
||||
@ -13,7 +11,7 @@
|
||||
static u3_noun
|
||||
_heal_by(u3_noun van,
|
||||
u3_noun sut,
|
||||
u3_noun qog,
|
||||
u3_noun qug,
|
||||
u3_noun ref)
|
||||
{
|
||||
u3_noun p_sut, q_sut;
|
||||
@ -30,11 +28,12 @@
|
||||
}
|
||||
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
if ( c3y == u3r_sing(u3h(p_sut), u3t(qog)) ) {
|
||||
if ( (c3y == u3du(u3t(qug))) &&
|
||||
(c3y == u3r_sing(u3h(p_sut), u3t(u3t(qug))) ) ) {
|
||||
return u3k(ref);
|
||||
}
|
||||
else {
|
||||
u3_noun sub = _heal_by(van, q_sut, qog, ref);
|
||||
u3_noun sub = _heal_by(van, q_sut, qug, ref);
|
||||
u3_noun ret;
|
||||
|
||||
ret = u3qfu_busk(van,
|
||||
@ -48,22 +47,23 @@
|
||||
}
|
||||
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
if ( c3y == u3r_sing(p_sut, u3t(qog)) ) {
|
||||
if ( (c3n == u3du(u3t(qug))) ||
|
||||
(c3y == u3r_sing(p_sut, u3t(u3t(qug)))) ) {
|
||||
return u3qf_face(p_sut, ref);
|
||||
}
|
||||
else return u3m_error("heal-name");
|
||||
}
|
||||
case c3__hold: {
|
||||
u3_noun rep = u3qfu_repo(van, sut);
|
||||
u3_noun ret = _heal_by(van, rep, qog, ref);
|
||||
u3_noun ret = _heal_by(van, rep, qug, ref);
|
||||
|
||||
u3z(rep);
|
||||
return ret;
|
||||
}
|
||||
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
u3_noun dis = _heal_by(van, p_sut, qog, ref);
|
||||
u3_noun dat = _heal_by(van, q_sut, qog, ref);
|
||||
u3_noun dis = _heal_by(van, p_sut, qug, ref);
|
||||
u3_noun dat = _heal_by(van, q_sut, qug, ref);
|
||||
u3_noun ret = u3qf_fork(dis, dat);
|
||||
|
||||
u3z(dis);
|
||||
@ -77,7 +77,7 @@
|
||||
_heal_to(u3_noun van,
|
||||
u3_noun sut,
|
||||
u3_noun gil,
|
||||
u3_noun qog,
|
||||
u3_noun qug,
|
||||
u3_noun ref,
|
||||
u3_atom now,
|
||||
u3_atom lat)
|
||||
@ -94,7 +94,7 @@
|
||||
|
||||
case c3__bull: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
u3_noun sub = _heal_to(van, q_sut, gil, qog, ref, now, lat);
|
||||
u3_noun sub = _heal_to(van, q_sut, gil, qug, ref, now, lat);
|
||||
u3_noun ret;
|
||||
|
||||
ret = u3qfu_busk
|
||||
@ -108,10 +108,10 @@
|
||||
u3_noun ter, ret;
|
||||
|
||||
if ( 2 == now ) {
|
||||
ter = _heal_as(van, p_sut, qog, lat, ref);
|
||||
ter = _heal_as(van, p_sut, qug, lat, ref);
|
||||
ret = u3qf_cell(ter, q_sut);
|
||||
} else {
|
||||
ter = _heal_as(van, q_sut, qog, lat, ref);
|
||||
ter = _heal_as(van, q_sut, qug, lat, ref);
|
||||
ret = u3qf_cell(p_sut, ter);
|
||||
}
|
||||
u3z(ter);
|
||||
@ -123,7 +123,7 @@
|
||||
if ( 3 != now ) {
|
||||
return u3m_error("heal-core");
|
||||
} else {
|
||||
u3_noun ter = _heal_as(van, p_sut, qog, lat, ref);
|
||||
u3_noun ter = _heal_as(van, p_sut, qug, lat, ref);
|
||||
u3_noun ret = u3qf_core(ter, q_sut);
|
||||
|
||||
u3z(ter);
|
||||
@ -132,7 +132,7 @@
|
||||
}
|
||||
case c3__face: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
u3_noun dun = _heal_to(van, q_sut, gil, qog, ref, now, lat);
|
||||
u3_noun dun = _heal_to(van, q_sut, gil, qug, ref, now, lat);
|
||||
u3_noun ret = u3qf_face(p_sut, dun);
|
||||
|
||||
u3z(dun);
|
||||
@ -140,8 +140,8 @@
|
||||
}
|
||||
case c3__fork: u3x_cell(u3t(sut), &p_sut, &q_sut);
|
||||
{
|
||||
u3_noun dis = _heal_to(van, p_sut, gil, qog, ref, now, lat);
|
||||
u3_noun dat = _heal_to(van, q_sut, gil, qog, ref, now, lat);
|
||||
u3_noun dis = _heal_to(van, p_sut, gil, qug, ref, now, lat);
|
||||
u3_noun dat = _heal_to(van, q_sut, gil, qug, ref, now, lat);
|
||||
u3_noun ret = u3qf_fork(dis, dat);
|
||||
|
||||
u3z(dis);
|
||||
@ -156,7 +156,7 @@
|
||||
else {
|
||||
u3_noun zoc = u3qdi_put(gil, sut);
|
||||
u3_noun rep = u3qfu_repo(van, sut);
|
||||
u3_noun ret = _heal_to(van, rep, zoc, qog, ref, now, lat);
|
||||
u3_noun ret = _heal_to(van, rep, zoc, qug, ref, now, lat);
|
||||
|
||||
u3z(rep);
|
||||
u3z(zoc);
|
||||
@ -168,7 +168,7 @@
|
||||
|
||||
repo: {
|
||||
u3_noun rep = u3qfu_repo(van, sut);
|
||||
u3_noun ret = _heal_to(van, rep, gil, qog, ref, now, lat);
|
||||
u3_noun ret = _heal_to(van, rep, gil, qug, ref, now, lat);
|
||||
|
||||
u3z(rep);
|
||||
return ret;
|
||||
@ -178,19 +178,19 @@
|
||||
static u3_noun
|
||||
_heal_as(u3_noun van,
|
||||
u3_noun sut,
|
||||
u3_noun qog,
|
||||
u3_noun qug,
|
||||
u3_atom axe,
|
||||
u3_noun ref)
|
||||
{
|
||||
if ( 1 == axe ) {
|
||||
if ( u3_nul == qog ) {
|
||||
if ( u3_nul == qug ) {
|
||||
return u3k(ref);
|
||||
} else return _heal_by(van, sut, qog, ref);
|
||||
} else return _heal_by(van, sut, qug, ref);
|
||||
}
|
||||
else {
|
||||
u3_atom now = u3qc_cap(axe);
|
||||
u3_atom lat = u3qc_mas(axe);
|
||||
u3_noun ret = _heal_to(van, sut, u3_nul, qog, ref, now, lat);
|
||||
u3_noun ret = _heal_to(van, sut, u3_nul, qug, ref, now, lat);
|
||||
|
||||
u3z(lat);
|
||||
return ret;
|
||||
@ -202,11 +202,11 @@
|
||||
u3_noun
|
||||
_cqfu_heal(u3_noun van,
|
||||
u3_noun sut,
|
||||
u3_noun qog,
|
||||
u3_noun qug,
|
||||
u3_noun axe,
|
||||
u3_noun ref)
|
||||
{
|
||||
return _heal_as(van, sut, qog, axe, ref);
|
||||
return _heal_as(van, sut, qug, axe, ref);
|
||||
}
|
||||
|
||||
/* boilerplate
|
||||
@ -214,9 +214,9 @@
|
||||
u3_noun
|
||||
u3wfu_heal(u3_noun cor)
|
||||
{
|
||||
u3_noun van, sut, qog, axe, ref;
|
||||
u3_noun van, sut, qug, axe, ref;
|
||||
|
||||
if ( (c3n == u3r_mean(cor, u3x_sam_2, &qog,
|
||||
if ( (c3n == u3r_mean(cor, u3x_sam_2, &qug,
|
||||
u3x_sam_6, &axe,
|
||||
u3x_sam_7, &ref,
|
||||
u3x_con, &van,
|
||||
@ -226,16 +226,17 @@
|
||||
{
|
||||
return u3m_bail(c3__fail);
|
||||
} else {
|
||||
return _cqfu_heal(van, sut, qog, axe, ref);
|
||||
return _cqfu_heal(van, sut, qug, axe, ref);
|
||||
}
|
||||
}
|
||||
|
||||
u3_noun
|
||||
u3qfu_heal(u3_noun van,
|
||||
u3_noun sut,
|
||||
u3_noun qog,
|
||||
u3_noun qug,
|
||||
u3_noun axe,
|
||||
u3_noun ref)
|
||||
{
|
||||
return _cqfu_heal(van, sut, qog, axe, ref);
|
||||
return _cqfu_heal(van, sut, qug, axe, ref);
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ static u3j_harm _mood__hoon__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
|
||||
static u3j_harm _mood__hoon__ut_firm_a[] = {{".2", u3wfu_firm}, {}};
|
||||
static u3j_harm _mood__hoon__ut_fish_a[] = {{".2", u3wfu_fish}, {}};
|
||||
static u3j_harm _mood__hoon__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}};
|
||||
// static u3j_harm _mood__hoon__ut_heal_a[] = {{".2", u3wfu_heal}, {}};
|
||||
static u3j_harm _mood__hoon__ut_heal_a[] = {{".2", u3wfu_heal}, {}};
|
||||
static u3j_harm _mood__hoon__ut_mint_a[] = {{".2", u3wfu_mint}, {}};
|
||||
static u3j_harm _mood__hoon__ut_mull_a[] = {{".2", u3wfu_mull}, {}};
|
||||
static u3j_harm _mood__hoon__ut_nest_a[] = {{".2", u3wfu_nest}, {}};
|
||||
@ -383,7 +383,7 @@ static u3j_core _mood__hoon__ut_d[] =
|
||||
{ "firm", _mood__hoon__ut_firm_a },
|
||||
{ "fish", _mood__hoon__ut_fish_a },
|
||||
{ "fuse", _mood__hoon__ut_fuse_a },
|
||||
// { "heal", _mood__hoon__ut_heal_a },
|
||||
{ "heal", _mood__hoon__ut_heal_a },
|
||||
{ "mint", _mood__hoon__ut_mint_a },
|
||||
{ "mull", _mood__hoon__ut_mull_a },
|
||||
{ "nest", _mood__hoon__ut_nest_a },
|
||||
|
Loading…
Reference in New Issue
Block a user