From d4af160f80a1434be85b4b54eb15b177191d3a06 Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sat, 14 Dec 2024 13:43:08 -0500 Subject: [PATCH] things & stuff --- src/errors.rs | 1 + src/main.rs | 9 +++------ src/process.rs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 4077e7a..182cd3a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -26,6 +26,7 @@ pub fn report_panic(err: LErr) { let i = first_span.start; let j = second_span.end; let label = Label::new((entry.input, i..j)) + .with_color(Color::Yellow) .with_message(format!("({order}) calling `{fn_name}` with `{arguments}`")); order += 1; stack.push(label); diff --git a/src/main.rs b/src/main.rs index ca9c620..b0e9413 100644 --- a/src/main.rs +++ b/src/main.rs @@ -196,12 +196,9 @@ pub fn run(src: &'static str) { pub fn main() { let src = " -loop (10) with { - (0) -> :done - (n) -> { - print! (n) - recur (dec (n)) - } +loop (100000, 1) with { + (1, acc) -> acc + (n, acc) -> recur (dec (n), add (n, acc)) } "; run(src); diff --git a/src/process.rs b/src/process.rs index 55d0fa0..5eb954f 100644 --- a/src/process.rs +++ b/src/process.rs @@ -326,7 +326,7 @@ impl<'src> Process<'src> { result } // TODO: partially applied functions shnould work! In #15 - (Fn(_f), Args(_args)) => todo!(), + (Fn(_f), Args(_partial_args)) => todo!(), (_, Keyword(_)) => Ok(Nil), (_, Args(_)) => self.panic("only functions and keywords may be called".to_string()), (Base(f), Tuple(args)) => match f {