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 i = first_span.start;
let j = second_span.end; let j = second_span.end;
let label = Label::new((entry.input, i..j)) let label = Label::new((entry.input, i..j))
.with_color(Color::Yellow)
.with_message(format!("({order}) calling `{fn_name}` with `{arguments}`")); .with_message(format!("({order}) calling `{fn_name}` with `{arguments}`"));
order += 1; order += 1;
stack.push(label); stack.push(label);

View File

@ -196,12 +196,9 @@ pub fn run(src: &'static str) {
pub fn main() { pub fn main() {
let src = " let src = "
loop (10) with { loop (100000, 1) with {
(0) -> :done (1, acc) -> acc
(n) -> { (n, acc) -> recur (dec (n), add (n, acc))
print! (n)
recur (dec (n))
}
} }
"; ";
run(src); run(src);

View File

@ -326,7 +326,7 @@ impl<'src> Process<'src> {
result result
} }
// TODO: partially applied functions shnould work! In #15 // TODO: partially applied functions shnould work! In #15
(Fn(_f), Args(_args)) => todo!(), (Fn(_f), Args(_partial_args)) => todo!(),
(_, Keyword(_)) => Ok(Nil), (_, Keyword(_)) => Ok(Nil),
(_, Args(_)) => self.panic("only functions and keywords may be called".to_string()), (_, Args(_)) => self.panic("only functions and keywords may be called".to_string()),
(Base(f), Tuple(args)) => match f { (Base(f), Tuple(args)) => match f {