Skip to content

Commit

Permalink
Implement %bout static hint (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamsden authored Jan 10, 2025
1 parent 9805331 commit 0570dc6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rust/sword/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,10 +1462,10 @@ mod hint {
/** Match static and dynamic hints before the nock formula is evaluated */
pub fn match_pre_nock(
context: &mut Context,
_subject: Noun,
subject: Noun,
tag: Atom,
hint: Option<(Noun, Noun)>,
_body: Noun,
body: Noun,
) -> Option<Result> {
// XX: handle IndirectAtom tags
match tag.direct()?.data() {
Expand All @@ -1476,6 +1476,15 @@ mod hint {
None
}
}
tas!(b"bout") => {
let start = Instant::now();
let res = interpret(context, subject, body);
if res.is_ok() {
let duration = start.elapsed();
flog!(context, "took: {duration:?}");
}
Some(res)
}
tas!(b"slog") => {
let stack = &mut context.stack;
let slogger = &mut context.slogger;
Expand Down

0 comments on commit 0570dc6

Please sign in to comment.