Supporting but not yet generating c3__moat.

This commit is contained in:
C. Guy Yarvin 2015-12-27 15:17:04 -05:00
parent eeab0af487
commit adaa5c7403
8 changed files with 96 additions and 4 deletions

View File

@ -686,6 +686,7 @@
# define c3__miss c3_s4('m','i','s','s')
# define c3__mix c3_s3('m','i','x')
# define c3__mod c3_s3('m','o','d')
# define c3__moat c3_s4('m','o','a','t')
# define c3__mold c3_s4('m','o','l','d')
# define c3__mong c3_s4('m','o','n','g')
# define c3__mono c3_s4('m','o','n','o')
@ -725,8 +726,8 @@
# define c3__new c3_s3('n','e','w')
# define c3__newt c3_s4('n','e','w','t')
# define c3__next c3_s4('n','e','x','t')
# define c3__nich c3_s4('n','i','b','h')
# define c3__nick c3_s4('n','i','b','k')
# define c3__nich c3_s4('n','i','c','h')
# define c3__nick c3_s4('n','i','c','k')
# define c3__nil c3_s3('n','i','l')
# define c3__nilk c3_s4('n','i','l','k')
# define c3__no c3_s2('n','o')

View File

@ -23,6 +23,9 @@
case c3__atom: p_sut = u3t(sut);
{
}
case c3__moat: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
}

View File

@ -25,6 +25,7 @@
default: return u3m_bail(c3__fail);
case c3__atom: return 0;
case c3__moat: return 0;
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3nc

View File

@ -66,6 +66,22 @@
if ( c3__atom == u3h(ref) ) {
return c3__void;
}
else if ( c3__moat == u3h(ref) ) {
return c3__void;
}
else if ( c3__cell == u3h(ref) ) {
return u3k(sut);
}
else return _crop_sint(van, sut, ref, bix);
}
case c3__moat:
{
if ( c3__atom == u3h(ref) ) {
return c3__void;
}
else if ( c3__moat == u3h(ref) ) {
return c3__void;
}
else if ( c3__cell == u3h(ref) ) {
return u3k(sut);
}
@ -76,6 +92,9 @@
if ( c3__atom == u3h(ref) ) {
return u3k(sut);
}
else if ( c3__moat == u3h(ref) ) {
return u3k(sut);
}
else if ( c3__cell == u3h(ref) ) {
u3x_cell(u3t(ref), &p_ref, &q_ref);
@ -93,7 +112,9 @@
}
case c3__core:
{
if ( (c3__atom == u3h(ref)) || (c3__cell == u3h(ref)) ) {
if ( (c3__atom == u3h(ref)) ||
(c3__moat == u3h(ref)) ||
(c3__cell == u3h(ref)) ) {
return u3k(sut);
}
else return _crop_sint(van, sut, ref, bix);
@ -105,7 +126,9 @@
{
return c3__void;
}
else if ( (c3__atom == u3h(ref)) || (c3__cell == u3h(ref)) ) {
else if ( (c3__atom == u3h(ref)) ||
(c3__moat == u3h(ref)) ||
(c3__cell == u3h(ref)) ) {
u3_noun foz = _crop_dext(van, q_sut, ref, bix);
u3_noun ret;

View File

@ -32,6 +32,10 @@
{
return u3ud(dib);
}
case c3__moat: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return u3ud(dib);
}
case c3__cell: u3x_cell(u3t(sut), &p_sut, &q_sut);
{
return c3a(u3du(dib),

View File

@ -34,6 +34,13 @@
u3z(ton);
return pro;
}
case c3__moat: {
u3_noun ton = u3nt(3, 0, u3k(axe));
u3_noun pro = u3qf_flip(ton);
u3z(ton);
return pro;
}
case c3__bull: {
if ( (c3n == u3r_trel(sut, 0, &p_sut, &q_sut)) ) {
return u3m_bail(c3__fail);

View File

@ -66,6 +66,30 @@
return u3k(sut);
} else return u3k(ref);
}
else if ( c3__moat == u3h(ref) ) {
if ( c3y == u3qf_fitz(u3h(u3t(ref)), u3t(sut)) ) {
return u3k(sut);
} else return u3k(ref);
}
else if ( c3__cell == u3h(ref) ) {
return c3__void;
}
}
return _fuse_in(van, ref, sut, bix);
}
case c3__moat:
{
if ( c3y == u3du(ref) ) {
if ( c3__atom == u3h(ref) ) {
if ( c3y == u3qf_fitz(u3t(ref), u3h(u3t(sut))) ) {
return u3k(sut);
} else return u3k(ref);
}
else if ( c3__moat == u3h(ref) ) {
if ( c3y == u3qf_fitz(u3h(u3t(ref)), u3h(u3t(sut))) ) {
return u3k(sut);
} else return u3k(ref);
}
else if ( c3__cell == u3h(ref) ) {
return c3__void;
}

View File

@ -206,6 +206,33 @@
}
return c3y;
}
else if ( (c3y == u3du(ref)) && (c3__moat == u3h(ref)) ) {
if ( c3n == u3qf_fitz(u3t(sut), u3h(u3t(ref))) ) {
// u3_err("fitz: need", u3t(sut));
// u3_err("fitz: have", u3t(ref));
return c3n;
}
return c3y;
}
else return _nest_sint(van, sut, tel, ref, gil);
}
case c3__moat: {
if ( (c3y == u3du(ref)) && (c3__atom == u3h(ref)) ) {
if ( c3n == u3qf_fitz(u3h(u3t(sut)), u3t(ref)) ) {
// u3_err("fitz: need", u3t(sut));
// u3_err("fitz: have", u3t(ref));
return c3n;
}
return c3y;
}
else if ( (c3y == u3du(ref)) && (c3__moat == u3h(ref)) ) {
if ( c3n == u3qf_fitz(u3h(u3t(sut)), u3h(u3t(ref))) ) {
// u3_err("fitz: need", u3t(sut));
// u3_err("fitz: have", u3t(ref));
return c3n;
}
return c3y;
}
else return _nest_sint(van, sut, tel, ref, gil);
}
case c3__cell: {
@ -261,6 +288,7 @@
default: return _nest_sint(van, sut, tel, ref, gil);
case c3__atom:
case c3__moat:
case c3__cell:
case c3__cube:
case c3__core:
@ -366,6 +394,7 @@
return u3m_bail(c3__fail);
}
case c3__atom: return c3n;
case c3__moat: return c3n;
case c3__cell: return c3n;
case c3__core: {
u3_noun gam = u3qfu_repo(van, ref);