Compare commits

..

2 Commits

Author SHA1 Message Date
Scott Richmond
3527530e39 release build 2025-07-06 19:00:45 -04:00
Scott Richmond
a534e241f9 improve pattern representation; fix get callsites 2025-07-06 19:00:03 -04:00
5 changed files with 11 additions and 5 deletions

View File

@ -920,7 +920,7 @@ fn get {
fn update {
"Takes a dict, key, and function, and returns a new dict with the key set to the result of applying the function to original value held at the key."
(d as :dict) -> d
(d as :dict, k as :keyword, updater as :fn) -> assoc (d, k, updater (get (k, d)))
(d as :dict, k as :keyword, updater as :fn) -> assoc (d, k, updater (get (d, k)))
}
fn keys {
@ -974,7 +974,7 @@ fn random {
}
(d as :dict) -> {
let key = do d > keys > random
get (key, d)
get (d, key)
}
& (s as :set) -> do s > list > random
}

View File

@ -306,7 +306,7 @@ function __wbg_get_imports() {
const ret = false;
return ret;
};
imports.wbg.__wbindgen_closure_wrapper1087 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper1088 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 356, __wbg_adapter_18);
return ret;
};

Binary file not shown.

View File

@ -156,7 +156,7 @@ fn traceback(panic: &Panic) -> String {
fn frame_info(frame: &CallFrame) -> String {
let span = frame.chunk().spans[if frame.ip == 0 { 0 } else { frame.ip - 1 }];
let line_number = line_number(frame.chunk().src, span);
console_log!("ip: {} | span: {span} | line: {line_number}", frame.ip);
// console_log!("ip: {} | span: {span} | line: {line_number}", frame.ip);
let line = get_line(frame.chunk().src, line_number);
let line = line.trim_start();
let name = frame.function.as_fn().name();

View File

@ -40,7 +40,13 @@ impl LFn {
pub fn patterns(&self) -> Value {
match self {
LFn::Declared { .. } => unreachable!(),
LFn::Defined { patterns, .. } => Value::from_string(patterns.join(" | ")),
LFn::Defined { patterns, .. } => Value::from_string(
patterns
.iter()
.map(|pattern| format!(" {pattern}"))
.collect::<Vec<_>>()
.join("\n"),
),
}
}