From fe3c0895b23b4658142baca601476853426e12d3 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 13 Feb 2023 10:57:13 -0700 Subject: [PATCH] [ares] comments and formatting --- rust/ares/src/interpreter.rs | 5 ++++- rust/ares/src/newt.rs | 2 +- rust/ares/src/serf.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rust/ares/src/interpreter.rs b/rust/ares/src/interpreter.rs index 9f5ece1..23a81ed 100644 --- a/rust/ares/src/interpreter.rs +++ b/rust/ares/src/interpreter.rs @@ -65,9 +65,10 @@ fn noun_to_work(noun: Noun) -> NockWork { } } +/** Interpret nock */ pub fn interpret( stack: &mut NockStack, - newt: &mut Option<&mut Newt>, + newt: &mut Option<&mut Newt>, // For printing slogs; if None, print to stdout mut subject: Noun, formula: Noun, ) -> Noun { @@ -623,6 +624,7 @@ fn inc(stack: &mut NockStack, atom: Atom) -> Atom { } } +/** Match hints which apply before the formula is evaluated */ fn match_pre_hint(stack: &mut NockStack, subject: Noun, cell: Cell) -> Result { let direct = cell.head().as_direct()?; match direct.data() { @@ -636,6 +638,7 @@ fn match_pre_hint(stack: &mut NockStack, subject: Noun, cell: Cell) -> Result, diff --git a/rust/ares/src/newt.rs b/rust/ares/src/newt.rs index cc18536..eef6f2c 100644 --- a/rust/ares/src/newt.rs +++ b/rust/ares/src/newt.rs @@ -51,7 +51,7 @@ * It's important to not use io::Stdin and io::Stdout directly. All printfs should use stderr. */ use crate::mem::NockStack; -use crate::noun::{T, IndirectAtom, Noun, D}; +use crate::noun::{IndirectAtom, Noun, D, T}; use crate::serialization::{cue, jam}; use ares_macros::tas; use either::Either; diff --git a/rust/ares/src/serf.rs b/rust/ares/src/serf.rs index dfe5819..7f26ebf 100644 --- a/rust/ares/src/serf.rs +++ b/rust/ares/src/serf.rs @@ -2,7 +2,7 @@ use crate::interpreter::{interpret, raw_slot}; use crate::mem::NockStack; use crate::mug::mug_u32; use crate::newt::Newt; -use crate::noun::{T, Noun, D}; +use crate::noun::{Noun, D, T}; use crate::snapshot::{load, save}; use ares_macros::tas; use std::fs::create_dir_all;