ut_find debugging branch with jet disabled.

This commit is contained in:
C. Guy Yarvin 2017-12-17 16:29:54 -08:00
parent 70487ba362
commit 0df247f9a2
5 changed files with 64 additions and 8 deletions

View File

@ -91,7 +91,7 @@ endif
INCLUDE=include
MDEFINES=-DU3_OS_$(OS) -DU3_OS_ENDIAN_$(ENDIAN)
DEBUG=no
DEBUG=yes
ifeq ($(DEBUG),yes)
CFLAGS=-g

View File

@ -13,6 +13,33 @@
u3_noun lon,
u3_noun gil);
static u3_noun
_opal_sane(u3_noun ope)
{
if ( (0 == u3h(ope)) && (0 == u3t(ope)) ) {
fprintf(stderr, "insane opal\r\n");
c3_assert(0);
}
else return ope;
}
static u3_noun
_pony_sane(u3_noun poy)
{
if ( 0 == poy ) {
return poy;
}
else if ( c3y != u3h(poy) ) {
return poy;
}
else {
u3_noun ttt_poy = u3t(u3t(u3t(poy))); // opal
_opal_sane(ttt_poy);
return poy;
}
}
static u3_noun
u3qfu_felt(u3_noun van,
u3_noun sut,
@ -600,7 +627,7 @@
}
static u3_noun
_find_buck(u3_noun van,
_find_bucx(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
@ -677,6 +704,20 @@
}
}
static u3_noun
_find_buck(u3_noun van,
u3_noun sut,
u3_noun way,
u3_noun p_heg,
u3_noun q_heg,
u3_noun axe,
u3_noun lon,
u3_noun gil)
{
u3_noun ret = _find_bucx(van, sut, way, p_heg, q_heg, axe, lon, gil);
return _pony_sane(ret);
}
static u3_noun
_find_limb(u3_noun van,
@ -688,6 +729,8 @@
u3_noun qp_mor = u3t(p_mor); // palo
u3_noun pqp_mor = u3h(qp_mor); // vein
u3_noun qqp_mor = u3t(qp_mor); // opal
qqp_mor = _opal_sane(qqp_mor);
{
u3_noun ref = u3qfu_felt(van, sut, qqp_mor);
u3_noun lon = u3k(pqp_mor);
@ -704,6 +747,8 @@
u3_nul,
u3nc(u3nc(u3_nul, u3k(p_heg)), u3k(lon)),
u3nc(c3y, u3qfu_peek(van, ref, way, p_heg)));
ret = _pony_sane(ret);
}
else {
u3_noun p_heg = u3h(u3t(heg)); // @ud
@ -716,7 +761,7 @@
u3z(lon);
u3z(ref);
return ret;
return _pony_sane(ret);
}
}
@ -727,13 +772,15 @@
u3_noun hyp)
{
if ( u3_nul == hyp ) {
return u3nq(c3y, u3_nul, u3_nul, u3nc(c3y, u3k(sut)));
return _pony_sane(u3nq(c3y, u3_nul, u3_nul, u3nc(c3y, u3k(sut))));
}
else {
u3_noun i_hyp = u3h(hyp);
u3_noun t_hyp = u3t(hyp);
u3_noun mor = _find_pony(van, sut, way, t_hyp);
mor = _pony_sane(mor);
if ( c3n == u3h(mor) ) {
u3_noun p_mor = u3t(mor);
@ -757,7 +804,7 @@
u3z(gen);
u3z(mor);
return ret;
return _pony_sane(ret);
}
}
else {
@ -765,7 +812,7 @@
u3_noun ret = _find_limb(van, sut, way, i_hyp, p_mor);
u3z(mor);
return ret;
return _pony_sane(ret);
}
}
}

View File

@ -718,6 +718,11 @@
u3_noun fid = _mint_in(van, sut, c3__noun, p_gen);
u3_noun p_fid = u3h(fid);
u3_noun q_fid = u3t(fid);
if ( 0 == p_fid ) {
u3m_p("bad subject: p_gen", p_gen);
c3_assert(0);
}
u3_noun dov = _mint_in(van, p_fid, gol, q_gen);
u3_noun p_dov = u3h(dov);
u3_noun q_dov = u3t(dov);

View File

@ -120,7 +120,7 @@ static u3j_core _143_hex_d[] =
static u3j_harm _143_pen__ut_conk_a[] = {{".2", u3wfu_conk}, {}};
static u3j_harm _143_pen__ut_crop_a[] = {{".2", u3wfu_crop}, {}};
// static u3j_harm _143_pen__ut_fire_a[] = {{".2", u3wfu_fire}, {}};
static u3j_harm _143_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}};
// static u3j_harm _143_pen__ut_fond_a[] = {{".2", u3wfu_fond}, {}};
static u3j_harm _143_pen__ut_fish_a[] = {{".2", u3wfu_fish}, {}};
static u3j_harm _143_pen__ut_fuse_a[] = {{".2", u3wfu_fuse}, {}};
static u3j_harm _143_pen__ut_mint_a[] = {{".2", u3wfu_mint}, {}};
@ -136,7 +136,7 @@ static u3j_core _143_hex_d[] =
{ "burn", _143_pen__ut_burn_a },
{ "conk", _143_pen__ut_conk_a },
{ "crop", _143_pen__ut_crop_a },
{ "fond", _143_pen__ut_fond_a },
// { "fond", _143_pen__ut_fond_a },
// { "fire", _143_pen__ut_fire_a },
{ "fish", _143_pen__ut_fish_a },
{ "fuse", _143_pen__ut_fuse_a },

View File

@ -82,6 +82,9 @@ u3t_slog(u3_noun hod)
void
u3t_heck(u3_atom cog)
{
#if 0
u3R->pro.cel_d++;
#else
c3_w len_w = u3r_met(3, cog);
c3_c* str_c = alloca(1 + len_w);
@ -104,6 +107,7 @@ u3t_heck(u3_atom cog)
}
u3R = rod_u;
}
#endif
}
/* _t_jet_label():