changed up how we are executing hoon. This fixes the issue we see with rpevious versions

This commit is contained in:
Amadeo Bellotti 2022-08-12 11:17:40 -04:00
parent 88860281b7
commit 9b095dbec7

View File

@ -1012,11 +1012,12 @@ _cw_eval_commence(c3_i argc, c3_c* argv[])
c3_c* line = NULL; c3_c* line = NULL;
size_t len = 0; size_t len = 0;
ssize_t nread; ssize_t nread;
c3_c* evl_c = "%- sell !> "; //c3_c* evl_c = "%- sell !> \n";
c3_c* evl_c = "";
while((nread = getline(&line, &len, stdin)) != -1) while((nread = getline(&line, &len, stdin)) != -1)
{ {
len = asprintf(&evl_c, "%s\n%s", evl_c, line); len = asprintf(&evl_c, "%s%s", evl_c, line);
} }
free(line); free(line);
@ -1045,15 +1046,24 @@ _cw_eval_commence(c3_i argc, c3_c* argv[])
printf("Executing hoon:\n"); printf("Executing hoon:\n");
//Run the input through a virtualization (u3v_wish_n) and get the ouput //Run the input through a virtualization (u3v_wish_n) and get the ouput
u3_noun res = u3m_soft(0, u3v_wish_n, u3i_string(evl_c)); //u3_noun res = u3m_soft(0, u3v_wish_n, u3i_string(evl_c));
u3_noun gat = u3v_wish("|=(a=@t (sell (slap !>(+>.$) (rain /eval a))))");
u3_noun sam = u3i_string(evl_c);
u3_noun cor = u3nc(u3k(u3h(gat)), u3nc(sam, u3k(u3t(u3t(gat)))));
u3_noun res = u3m_soft(0, u3n_kick_on, cor);
if(0 == u3h(res)){//Succuessful execution print the output if(0 == u3h(res)){//Succuessful execution print the output
u3_pier_tank(0,0,u3k(u3t(res))); u3_pier_tank(0,0,u3k(u3t(res)));
}else{ }else{
u3_pier_punt_goof("error", u3k(res)); //print stack trace error u3_pier_punt_goof("Hoon Error", u3k(res)); //print stack trace error
} }
u3z(res); u3z(res);
u3z(gat);
//u3z(sam);
//u3z(cor);
//printf("finishing\n"); //printf("finishing\n");
} }