From 0570dc65cee45a7f18e653236a5d3bbd88ba6176 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Fri, 10 Jan 2025 12:32:35 -0600 Subject: [PATCH] Implement %bout static hint (#292) --- rust/sword/src/interpreter.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rust/sword/src/interpreter.rs b/rust/sword/src/interpreter.rs index 13f99a9c..72ff365e 100644 --- a/rust/sword/src/interpreter.rs +++ b/rust/sword/src/interpreter.rs @@ -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 { // XX: handle IndirectAtom tags match tag.direct()?.data() { @@ -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;