mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
changed up how we are executing hoon. This fixes the issue we see with rpevious versions
This commit is contained in:
parent
88860281b7
commit
9b095dbec7
@ -1012,11 +1012,12 @@ _cw_eval_commence(c3_i argc, c3_c* argv[])
|
||||
c3_c* line = NULL;
|
||||
size_t len = 0;
|
||||
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)
|
||||
{
|
||||
len = asprintf(&evl_c, "%s\n%s", evl_c, line);
|
||||
len = asprintf(&evl_c, "%s%s", evl_c, line);
|
||||
}
|
||||
|
||||
free(line);
|
||||
@ -1045,15 +1046,24 @@ _cw_eval_commence(c3_i argc, c3_c* argv[])
|
||||
printf("Executing hoon:\n");
|
||||
|
||||
//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
|
||||
u3_pier_tank(0,0,u3k(u3t(res)));
|
||||
}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(gat);
|
||||
//u3z(sam);
|
||||
//u3z(cor);
|
||||
|
||||
//printf("finishing\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user