things & stuff

This commit is contained in:
Scott Richmond 2024-12-14 13:43:08 -05:00
parent 8535225167
commit d4af160f80
3 changed files with 5 additions and 7 deletions

View File

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

View File

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

View File

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