[ares] comments and formatting

This commit is contained in:
Philip Monk 2023-02-13 10:57:13 -07:00
parent ff59ca8ba9
commit fe3c0895b2
3 changed files with 6 additions and 3 deletions

View File

@ -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<Noun, ()> {
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<No
}
}
/** Match static hints and dynamic hints after they're evaluated */
fn match_post_hint(
stack: &mut NockStack,
newt: &mut Option<&mut Newt>,

View File

@ -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;

View File

@ -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;