mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-02 12:05:28 +03:00
vere: add hela and nara hints
This commit is contained in:
parent
ee46c6a0dd
commit
7fa53169f2
@ -130,29 +130,29 @@
|
||||
void
|
||||
u3t_boot(void);
|
||||
|
||||
/* dynamic_header: slog a vere headline, and hoon hint with
|
||||
/* u3t_dynamic_header: slog a vere headline, and hoon hint with
|
||||
* a given indent-style c3_l int (assumed 0-3).
|
||||
*/
|
||||
void
|
||||
dynamic_header(c3_l pri_l, u3_noun headline, u3_noun message);
|
||||
u3t_dynamic_header(c3_l pri_l, u3_noun headline, u3_noun message);
|
||||
|
||||
/* slog_trace: given an indent-style c3_l int and a raw stack tax
|
||||
/* u3t_slog_trace: given an indent-style c3_l int and a raw stack tax
|
||||
* flop the order into start-to-end, render, and slog each item
|
||||
* until done.
|
||||
*/
|
||||
void
|
||||
slog_trace(c3_l pri_l, u3_noun tax);
|
||||
u3t_slog_trace(c3_l pri_l, u3_noun tax);
|
||||
|
||||
/* near_trace: slog only the deepest road's trace
|
||||
/* u3t_nara: slog only the deepest road's trace
|
||||
*/
|
||||
void
|
||||
near_trace(c3_l pri_l);
|
||||
u3t_nara(c3_l pri_l);
|
||||
|
||||
/* full_trace: join all roads' traces together into one tax
|
||||
/* u3t_hela: join all roads' traces together into one tax
|
||||
* and pass it to slog_trace allong with the given pri_l
|
||||
*/
|
||||
void
|
||||
full_trace(c3_l pri_l);
|
||||
u3t_hela(c3_l pri_l);
|
||||
|
||||
/** Globals.
|
||||
**/
|
||||
|
@ -1703,11 +1703,11 @@ _n_hilt_fore(u3_noun hin, u3_noun bus, u3_noun* out)
|
||||
*out = u3i_cell(u3h(hin), now);
|
||||
}
|
||||
else if ( c3__nara == u3h(hin) ) {
|
||||
near_trace(0);
|
||||
u3t_nara(0);
|
||||
*out = u3_nul;
|
||||
}
|
||||
else if ( c3__hela == u3h(hin) ) {
|
||||
full_trace(0);
|
||||
u3t_hela(0);
|
||||
*out = u3_nul;
|
||||
}
|
||||
else {
|
||||
@ -1796,7 +1796,7 @@ _n_hint_hind(u3_noun tok, u3_noun pro)
|
||||
// prepend the priority to form a cell of the same shape q_tok
|
||||
// send this to ut3_slog so that it can be logged out
|
||||
c3_l pri_l = c3y == u3a_is_cat(p_q_tok) ? p_q_tok : 0;
|
||||
dynamic_header(pri_l, u3k(q_q_tok), u3i_string(str_c));
|
||||
u3t_dynamic_header(pri_l, u3k(q_q_tok), u3i_string(str_c));
|
||||
u3z(delta);
|
||||
}
|
||||
else if ( (c3y == u3r_trel(tok, &p_tok, &q_tok, &r_tok)) &&
|
||||
@ -1816,12 +1816,12 @@ _n_hint_hind(u3_noun tok, u3_noun pro)
|
||||
// prepend the priority to form a cell of the same shape q_tok
|
||||
// send this to ut3_slog so that it can be logged out
|
||||
c3_l pri_l = c3y == u3a_is_cat(p_q_tok) ? p_q_tok : 0;
|
||||
dynamic_header(pri_l, u3i_string(str_c), u3k(q_q_tok));
|
||||
u3t_dynamic_header(pri_l, u3i_string(str_c), u3k(q_q_tok));
|
||||
if (c3__nara == p_tok) {
|
||||
near_trace(pri_l);
|
||||
u3t_nara(pri_l);
|
||||
}
|
||||
else {
|
||||
full_trace(pri_l);
|
||||
u3t_hela(pri_l);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -594,7 +594,7 @@ u3t_boff(void)
|
||||
* and message is provided by the hint-caller
|
||||
*/
|
||||
void
|
||||
dynamic_header(c3_l pri_l, u3_noun headline, u3_noun message)
|
||||
u3t_dynamic_header(c3_l pri_l, u3_noun headline, u3_noun message)
|
||||
{
|
||||
u3t_slog(
|
||||
u3nc(
|
||||
@ -611,7 +611,7 @@ dynamic_header(c3_l pri_l, u3_noun headline, u3_noun message)
|
||||
/* This flops the given tax and slogs it entry by entry.
|
||||
*/
|
||||
void
|
||||
slog_trace
|
||||
u3t_slog_trace
|
||||
(c3_l pri_l, u3_noun tax)
|
||||
{
|
||||
// render the stack
|
||||
@ -643,17 +643,17 @@ slog_trace
|
||||
* it takes a c3_l pri_l
|
||||
*/
|
||||
void
|
||||
near_trace(c3_l pri_l)
|
||||
u3t_nara(c3_l pri_l)
|
||||
{
|
||||
u3_noun tax = u3k(u3R->bug.tax);
|
||||
slog_trace(pri_l, tax);
|
||||
u3t_slog_trace(pri_l, tax);
|
||||
}
|
||||
|
||||
/* this function joins all the road traces together
|
||||
* into a sinlge trace, which it sends to slog_trace
|
||||
*/
|
||||
void
|
||||
full_trace(c3_l pri_l)
|
||||
u3t_hela(c3_l pri_l)
|
||||
{
|
||||
// rod_u protects us from mutating the global state
|
||||
u3_road* rod_u = u3R;
|
||||
@ -668,6 +668,6 @@ full_trace(c3_l pri_l)
|
||||
tax = u3kb_weld(tax, u3k(rod_u->bug.tax));
|
||||
}
|
||||
|
||||
slog_trace(pri_l, tax);
|
||||
u3t_slog_trace(pri_l, tax);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user