From 026681787a6aab7f218492b0a614519df3282639 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 29 Jan 2025 04:16:28 -0600 Subject: [PATCH] cl-interpret: Add a new pretty-debug-printer builtin --- compiler/cl-interpret/src/builtin.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/cl-interpret/src/builtin.rs b/compiler/cl-interpret/src/builtin.rs index 652b370..bb32d2f 100644 --- a/compiler/cl-interpret/src/builtin.rs +++ b/compiler/cl-interpret/src/builtin.rs @@ -53,6 +53,14 @@ builtins! { Ok(args.into()) } + pub fn dbgp<_, args> () -> IResult { + let mut out = stdout().lock(); + for arg in args { + writeln!(out, "{arg:#?}").ok(); + } + Ok(ConValue::Empty) + } + /// Dumps info from the environment pub fn dump() -> IResult { println!("{}", *env); @@ -104,6 +112,7 @@ builtins! { Ok(ConValue::Empty) } } + builtins! { const BINARY; /// Multiplication `a * b`