diff --git a/Cargo.lock b/Cargo.lock index 700d2d9b5..7ad8d9447 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,6 +62,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "beef" version = "0.5.2" @@ -92,9 +98,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" dependencies = [ "clap_builder", "clap_derive", @@ -114,9 +120,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" dependencies = [ "heck", "proc-macro2", @@ -189,9 +195,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "highlight_error" @@ -202,8 +208,9 @@ checksum = "809e18805660d7b6b2e2b9f316a5099521b5998d5cba4dda11b5157a21aaef03" [[package]] name = "hvm-core" version = "0.2.19" -source = "git+https://github.com/HigherOrderCO/hvm-core.git?branch=feature/sc-506/smart-pointer-def-api#80b0a403b836a51a8b0c57775188f84f7c186c72" +source = "git+https://github.com/HigherOrderCO/hvm-core.git?branch=feature/sc-506/smart-pointer-def-api#fcb44d972fca4c026a714ab6770788ac4c7b3741" dependencies = [ + "arrayvec", "clap", "nohash-hasher", "stacker", @@ -403,9 +410,9 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.52" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", diff --git a/src/hvmc_net/mutual_recursion.rs b/src/hvmc_net/mutual_recursion.rs index dbacb819e..2036864f0 100644 --- a/src/hvmc_net/mutual_recursion.rs +++ b/src/hvmc_net/mutual_recursion.rs @@ -95,17 +95,16 @@ impl Graph { fn collect_refs(current: Ref, tree: &Tree, graph: &mut Graph) { match tree { Tree::Ref { nam } => graph.add(current, nam.clone()), - Tree::Ctr { box lft, rgt, .. } => { - if let Tree::Ref { nam } = lft { - graph.add(current.clone(), nam.clone()); + Tree::Ctr { ports, .. } => { + if let Some(last) = ports.last() { + collect_refs(current, last, graph); } - collect_refs(current, rgt, graph); } - Tree::Op { rhs: fst, out: snd, .. } | Tree::Mat { sel: fst, ret: snd } => { - collect_refs(current.clone(), fst, graph); - collect_refs(current, snd, graph); + tree => { + for subtree in tree.children() { + collect_refs(current.clone(), subtree, graph); + } } - Tree::Era | Tree::Num { .. } | Tree::Var { .. } => (), } } diff --git a/src/hvmc_net/prune.rs b/src/hvmc_net/prune.rs index 4057a0acc..627241fa3 100644 --- a/src/hvmc_net/prune.rs +++ b/src/hvmc_net/prune.rs @@ -21,16 +21,12 @@ pub fn prune_defs(book: &mut Book, entrypoint: String) { } fn used_defs_in_tree(tree: &Tree, used_defs: &mut HashSet, to_visit: &mut Vec) { - match tree { - Tree::Ref { nam } => { - if used_defs.insert(nam.clone()) { - to_visit.push(nam.clone()); - } + if let Tree::Ref { nam } = tree { + if used_defs.insert(nam.clone()) { + to_visit.push(nam.clone()); } - Tree::Ctr { lft, rgt, .. } | Tree::Op { rhs: lft, out: rgt, .. } | Tree::Mat { sel: lft, ret: rgt } => { - used_defs_in_tree(lft, used_defs, to_visit); - used_defs_in_tree(rgt, used_defs, to_visit); - } - Tree::Var { .. } | Tree::Num { .. } | Tree::Era => (), + } + for subtree in tree.children() { + used_defs_in_tree(subtree, used_defs, to_visit); } } diff --git a/src/lib.rs b/src/lib.rs index 6d04a4ac2..9eccf45ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ use builtins::create_host; use diagnostics::{DiagnosticOrigin, Diagnostics, DiagnosticsConfig, Severity}; use hvmc::{ - ast::{self, Net}, + ast::Net, dispatch_dyn_net, host::Host, run::{DynNet, Heap, Rewrites}, @@ -196,27 +196,13 @@ pub fn count_nodes<'l>(net: &'l hvmc::ast::Net) -> usize { visit.push(r); } while let Some(tree) = visit.pop() { - match tree { - ast::Tree::Ctr { lft, rgt, .. } => { - count += 1; - visit.push(lft); - visit.push(rgt); - } - ast::Tree::Op { rhs, out, .. } => { - count += 1; - visit.push(rhs); - visit.push(out); - } - ast::Tree::Mat { sel, ret } => { - count += 1; - visit.push(sel); - visit.push(ret); - } - ast::Tree::Var { .. } => (), - _ => { - count += 1; - } - }; + // If it is not 0-ary, then we'll count it as a node. + if tree.children().next().is_some() { + count += 1; + } + for subtree in tree.children() { + visit.push(subtree); + } } count } diff --git a/src/net/hvmc_to_net.rs b/src/net/hvmc_to_net.rs index 11ffc9a8b..fa5786a22 100644 --- a/src/net/hvmc_to_net.rs +++ b/src/net/hvmc_to_net.rs @@ -17,6 +17,7 @@ fn hvmc_to_inodes(net: &Net) -> INodes { let mut root = tree_to_inodes(&net.root, "_".to_string(), net_root, &mut n_vars); inodes.append(&mut root); } + // Convert all the trees forming active pairs. for (i, (tree1, tree2)) in net.redexes.iter().enumerate() { let tree_root = format!("a{i}"); @@ -28,13 +29,13 @@ fn hvmc_to_inodes(net: &Net) -> INodes { inodes } -fn tree_to_inodes(tree: &Tree, tree_root: String, net_root: &str, n_vars: &mut NodeId) -> INodes { - fn new_var(n_vars: &mut NodeId) -> String { - let new_var = format!("x{n_vars}"); - *n_vars += 1; - new_var - } +fn new_var(n_vars: &mut NodeId) -> String { + let new_var = format!("x{n_vars}"); + *n_vars += 1; + new_var +} +fn tree_to_inodes(tree: &Tree, tree_root: String, net_root: &str, n_vars: &mut NodeId) -> INodes { fn process_node_subtree<'a>( subtree: &'a Tree, net_root: &str, @@ -42,11 +43,63 @@ fn tree_to_inodes(tree: &Tree, tree_root: String, net_root: &str, n_vars: &mut N n_vars: &mut NodeId, ) -> String { if let Tree::Var { nam } = subtree { - if nam == net_root { "_".to_string() } else { nam.clone() } + return if nam == net_root { "_".to_string() } else { nam.clone() }; + } + if let Tree::Ctr { ports, .. } = subtree { + if ports.len() == 1 { + return process_node_subtree(&ports[0], net_root, subtrees, n_vars); + } + } + + let var = new_var(n_vars); + subtrees.push((var.clone(), subtree)); + var + } + + fn process_ctr<'a>( + inodes: &mut Vec, + lab: u16, + ports: &'a [Tree], + net_root: &str, + principal: String, + subtrees: &mut Vec<(String, &'a Tree)>, + n_vars: &mut NodeId, + ) { + fn process_sub_ctr<'a>( + inodes: &mut Vec, + lab: u16, + ports: &'a [Tree], + net_root: &str, + subtrees: &mut Vec<(String, &'a Tree)>, + n_vars: &mut NodeId, + ) -> String { + if ports.len() == 1 { + process_node_subtree(&ports[0], net_root, subtrees, n_vars) + } else { + let principal = new_var(n_vars); + process_ctr(inodes, lab, ports, net_root, principal.clone(), subtrees, n_vars); + principal + } + } + if ports.is_empty() { + let inner = new_var(n_vars); + inodes.push(INode { kind: Era, ports: [principal, inner.clone(), inner] }); + } else if ports.len() == 1 { + subtrees.push((principal, &ports[0])); } else { - let var = new_var(n_vars); - subtrees.push((var.clone(), subtree)); - var + // build a 2-ary node + let kind = if lab == 0 { + Con { lab: None } + } else if lab == 1 { + Tup + } else if lab & 1 == 0 { + Con { lab: Some((lab as u32 >> 1) - 1) } + } else { + Dup { lab: (lab as u32 >> 1) - 1 } + }; + let rgt = process_sub_ctr(inodes, lab, &ports[1 ..], net_root, subtrees, n_vars); + let lft = process_node_subtree(&ports[0], net_root, subtrees, n_vars); + inodes.push(INode { kind, ports: [principal.clone(), lft.clone(), rgt.clone()] }); } } @@ -58,21 +111,8 @@ fn tree_to_inodes(tree: &Tree, tree_root: String, net_root: &str, n_vars: &mut N let var = new_var(n_vars); inodes.push(INode { kind: Era, ports: [subtree_root, var.clone(), var] }); } - Tree::Ctr { lft, rgt, lab } => { - let lft = process_node_subtree(lft, net_root, &mut subtrees, n_vars); - let rgt = process_node_subtree(rgt, net_root, &mut subtrees, n_vars); - inodes.push(INode { - kind: if *lab == 0 { - Con { lab: None } - } else if *lab == 1 { - Tup - } else if lab & 1 == 0 { - Con { lab: Some((*lab as u32 >> 1) - 1) } - } else { - Dup { lab: (*lab as u32 >> 1) - 1 } - }, - ports: [subtree_root, lft, rgt], - }); + Tree::Ctr { lab, ports } => { + process_ctr(&mut inodes, *lab, ports, net_root, subtree_root, &mut subtrees, n_vars) } Tree::Var { .. } => unreachable!(), Tree::Ref { nam } => { @@ -91,11 +131,23 @@ fn tree_to_inodes(tree: &Tree, tree_root: String, net_root: &str, n_vars: &mut N let out = process_node_subtree(out, net_root, &mut subtrees, n_vars); inodes.push(INode { kind, ports: [subtree_root, rhs, out] }); } - Tree::Mat { sel, ret } => { + Tree::Mat { zero, succ, out } => { let kind = Mat; - let sel = process_node_subtree(sel, net_root, &mut subtrees, n_vars); - let ret = process_node_subtree(ret, net_root, &mut subtrees, n_vars); - inodes.push(INode { kind, ports: [subtree_root, sel, ret] }); + let zero = process_node_subtree(zero, net_root, &mut subtrees, n_vars); + let succ = process_node_subtree(succ, net_root, &mut subtrees, n_vars); + let sel_var = new_var(n_vars); + inodes.push(INode { kind: Con { lab: None }, ports: [sel_var.clone(), zero, succ] }); + let ret = process_node_subtree(out, net_root, &mut subtrees, n_vars); + inodes.push(INode { kind, ports: [subtree_root, sel_var, ret] }); + } + Tree::Adt { .. } => { + // FIXME: hvm-core will implement a desugaring pass + // that will handle desugaring Adts nodes for us. + // It doesn't yet do this. However, we aren't creating Adt nodes + // either, so it's impossible for this to happen. + + // should have been desugared earlier + unreachable!() } } } diff --git a/src/net/net_to_hvmc.rs b/src/net/net_to_hvmc.rs index ebf069d5d..f982227a4 100644 --- a/src/net/net_to_hvmc.rs +++ b/src/net/net_to_hvmc.rs @@ -51,24 +51,32 @@ fn net_tree_to_hvmc_tree(inet: &INet, tree_root: NodeId, port_to_var_id: &mut Ha NodeKind::Era => Tree::Era, NodeKind::Con { lab: None } => Tree::Ctr { lab: 0, - lft: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), - rgt: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), + ports: vec![ + var_or_subtree(inet, Port(tree_root, 1), port_to_var_id), + var_or_subtree(inet, Port(tree_root, 2), port_to_var_id), + ], }, NodeKind::Tup => Tree::Ctr { lab: 1, - lft: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), - rgt: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), + ports: vec![ + var_or_subtree(inet, Port(tree_root, 1), port_to_var_id), + var_or_subtree(inet, Port(tree_root, 2), port_to_var_id), + ], }, NodeKind::Con { lab: Some(lab) } => Tree::Ctr { #[allow(clippy::identity_op)] lab: (*lab as u16 + 1) << 1 | 0, - lft: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), - rgt: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), + ports: vec![ + var_or_subtree(inet, Port(tree_root, 1), port_to_var_id), + var_or_subtree(inet, Port(tree_root, 2), port_to_var_id), + ], }, NodeKind::Dup { lab } => Tree::Ctr { lab: (*lab as u16 + 1) << 1 | 1, - lft: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), - rgt: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), + ports: vec![ + var_or_subtree(inet, Port(tree_root, 1), port_to_var_id), + var_or_subtree(inet, Port(tree_root, 2), port_to_var_id), + ], }, NodeKind::Ref { def_name } => Tree::Ref { nam: def_name.to_string() }, NodeKind::Num { val } => Tree::Num { val: *val }, @@ -77,10 +85,18 @@ fn net_tree_to_hvmc_tree(inet: &INet, tree_root: NodeId, port_to_var_id: &mut Ha rhs: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), out: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), }, - NodeKind::Mat => Tree::Mat { - sel: Box::new(var_or_subtree(inet, Port(tree_root, 1), port_to_var_id)), - ret: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), - }, + NodeKind::Mat => { + let node = inet.node(inet.enter_port(Port(tree_root, 1)).node()); + if node.kind != (NodeKind::Con { lab: None }) { + panic!("hvm-lang produced an INet where the first port is not a Con node. This is not supported."); + } + + Tree::Mat { + zero: Box::new(var_or_subtree(inet, inet.enter_port(node.aux1), port_to_var_id)), + succ: Box::new(var_or_subtree(inet, inet.enter_port(node.aux2), port_to_var_id)), + out: Box::new(var_or_subtree(inet, Port(tree_root, 2), port_to_var_id)), + } + } NodeKind::Rot => unreachable!(), } } diff --git a/tests/snapshots/cli__debug_u60_to_nat.hvm.snap b/tests/snapshots/cli__debug_u60_to_nat.hvm.snap index fa90a4051..6ff662490 100644 --- a/tests/snapshots/cli__debug_u60_to_nat.hvm.snap +++ b/tests/snapshots/cli__debug_u60_to_nat.hvm.snap @@ -4,7 +4,11 @@ input_file: tests/golden_tests/cli/debug_u60_to_nat.hvm --- (λa (U60ToNat a) 4) --------------------------------------- -(U60ToNat 4) +(λa match a { 0: Z; 1+b: (S (U60ToNat b)) } 4) +--------------------------------------- +match 4 { 0: Z; 1+a: (S (U60ToNat a)) } +--------------------------------------- +(λa λb (S (U60ToNat b)) * 3) --------------------------------------- (λa (S (U60ToNat a)) 3) --------------------------------------- diff --git a/tests/snapshots/compile_file__implicit_match_in_match_arg.hvm.snap b/tests/snapshots/compile_file__implicit_match_in_match_arg.hvm.snap index c9c278a0c..71db05213 100644 --- a/tests/snapshots/compile_file__implicit_match_in_match_arg.hvm.snap +++ b/tests/snapshots/compile_file__implicit_match_in_match_arg.hvm.snap @@ -2,4 +2,4 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_file/implicit_match_in_match_arg.hvm --- -@main = (?<(#0 (a a)) ?<(#0 (b b)) c>> c) +@main = (?<#0 (a a) ?<#0 (b b) c>> c) diff --git a/tests/snapshots/compile_file__match_num_all_patterns.hvm.snap b/tests/snapshots/compile_file__match_num_all_patterns.hvm.snap index 801a0e584..30f2eedf0 100644 --- a/tests/snapshots/compile_file__match_num_all_patterns.hvm.snap +++ b/tests/snapshots/compile_file__match_num_all_patterns.hvm.snap @@ -27,18 +27,18 @@ In definition 'zero_var_succ': Definition is unused. @main = #0 -@succ_var = (?<(#0 (a a)) b> b) -@succ_var_zero = (?<(a @succ_var_zero$C0) b> b) +@succ_var = (?<#0 (a a) b> b) +@succ_var_zero = (? b) & #0 ~ <+ #1 a> @succ_var_zero$C0 = (<+ #2 a> a) -@succ_zero = (?<(#0 (a a)) b> b) -@succ_zero_succ = (?<(#0 (a a)) b> b) -@succ_zero_var = (?<(#0 (a a)) b> b) +@succ_zero = (?<#0 (a a) b> b) +@succ_zero_succ = (?<#0 (a a) b> b) +@succ_zero_var = (?<#0 (a a) b> b) @var_succ = (a a) @var_zero = (a a) -@zero_succ = (?<(#0 (a a)) b> b) -@zero_succ_var = (?<(#0 (a a)) b> b) -@zero_var = (?<(#0 @zero_var$C0) a> a) +@zero_succ = (?<#0 (a a) b> b) +@zero_succ_var = (?<#0 (a a) b> b) +@zero_var = (?<#0 @zero_var$C0 a> a) @zero_var$C0 = (<+ #1 <- #1 a>> a) -@zero_var_succ = (?<(#0 @zero_var_succ$C0) a> a) +@zero_var_succ = (?<#0 @zero_var_succ$C0 a> a) @zero_var_succ$C0 = (<+ #1 <- #1 a>> a) diff --git a/tests/snapshots/compile_file__match_num_unscoped_lambda.hvm.snap b/tests/snapshots/compile_file__match_num_unscoped_lambda.hvm.snap index a859b2208..5fc61aa17 100644 --- a/tests/snapshots/compile_file__match_num_unscoped_lambda.hvm.snap +++ b/tests/snapshots/compile_file__match_num_unscoped_lambda.hvm.snap @@ -8,6 +8,6 @@ In definition 'lambda_in': In definition 'lambda_out': Definition is unused. -@lambda_in = (?<((a a) (b (c b))) (c d)> d) -@lambda_out = (?<(a (b b)) c> (a c)) +@lambda_in = (?<(a a) (b (c b)) (c d)> d) +@lambda_out = (? (a c)) @main = * diff --git a/tests/snapshots/compile_file_o_all__extracted_match_pred.hvm.snap b/tests/snapshots/compile_file_o_all__extracted_match_pred.hvm.snap index 4cade8a51..1c02dfa8c 100644 --- a/tests/snapshots/compile_file_o_all__extracted_match_pred.hvm.snap +++ b/tests/snapshots/compile_file_o_all__extracted_match_pred.hvm.snap @@ -4,5 +4,4 @@ input_file: tests/golden_tests/compile_file_o_all/extracted_match_pred.hvm --- @main = a & @val ~ (#1 a) -@val = (?<(#0 @val) a> a) - +@val = (?<#0 @val a> a) diff --git a/tests/snapshots/compile_file_o_all__linearize_match.hvm.snap b/tests/snapshots/compile_file_o_all__linearize_match.hvm.snap index 9ccd7f5ee..a4caa6d56 100644 --- a/tests/snapshots/compile_file_o_all__linearize_match.hvm.snap +++ b/tests/snapshots/compile_file_o_all__linearize_match.hvm.snap @@ -2,5 +2,4 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_file_o_all/linearize_match.hvm --- -@main = (?<((a a) (<+ b c> (b c))) d> d) - +@main = (?<(a a) (<+ b c> (b c)) d> d) diff --git a/tests/snapshots/compile_file_o_all__match_mult_linearization.hvm.snap b/tests/snapshots/compile_file_o_all__match_mult_linearization.hvm.snap index b681e3eda..92ac50ca4 100644 --- a/tests/snapshots/compile_file_o_all__match_mult_linearization.hvm.snap +++ b/tests/snapshots/compile_file_o_all__match_mult_linearization.hvm.snap @@ -2,5 +2,4 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_file_o_all/match_mult_linearization.hvm --- -@main = (?<((<+ a <+ b c>> (a (b c))) (<+ d <+ e <+ f g>>> (d (e (f g))))) h> h) - +@main = (?<(<+ a <+ b c>> (a (b c))) (<+ d <+ e <+ f g>>> (d (e (f g)))) h> h) diff --git a/tests/snapshots/compile_file_o_all__match_num_explicit_bind.hvm.snap b/tests/snapshots/compile_file_o_all__match_num_explicit_bind.hvm.snap index 0e9da92a6..95f294bc8 100644 --- a/tests/snapshots/compile_file_o_all__match_num_explicit_bind.hvm.snap +++ b/tests/snapshots/compile_file_o_all__match_num_explicit_bind.hvm.snap @@ -4,5 +4,4 @@ input_file: tests/golden_tests/compile_file_o_all/match_num_explicit_bind.hvm --- @main = a & @pred ~ (#4 a) -@pred = (?<(#0 (a a)) b> b) - +@pred = (?<#0 (a a) b> b) diff --git a/tests/snapshots/compile_file_o_all__num_pattern_with_var.hvm.snap b/tests/snapshots/compile_file_o_all__num_pattern_with_var.hvm.snap index 6dcae01fa..b1cb6df78 100644 --- a/tests/snapshots/compile_file_o_all__num_pattern_with_var.hvm.snap +++ b/tests/snapshots/compile_file_o_all__num_pattern_with_var.hvm.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_file_o_all/num_pattern_with_var.hvm --- @Foo = ({2 (* #0) {2 @Foo$C1 a}} a) -@Foo$C1 = (?<(#0 (a a)) b> b) +@Foo$C1 = (?<#0 (a a) b> b) @main = a & @Foo ~ (@true (#3 a)) @true = {2 * {2 a a}} diff --git a/tests/snapshots/compile_file_o_all__recursive_combinator_inactive.hvm.snap b/tests/snapshots/compile_file_o_all__recursive_combinator_inactive.hvm.snap index 6bd511965..3a33f3235 100644 --- a/tests/snapshots/compile_file_o_all__recursive_combinator_inactive.hvm.snap +++ b/tests/snapshots/compile_file_o_all__recursive_combinator_inactive.hvm.snap @@ -2,7 +2,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_file_o_all/recursive_combinator_inactive.hvm --- -@Foo = (?<({3 @Foo @Foo} @Foo$C0) a> a) +@Foo = (?<{3 @Foo @Foo} @Foo$C0 a> a) @Foo$C0 = (a (* a)) @main = a & @Foo ~ (#0 a) diff --git a/tests/snapshots/compile_file_o_all__sum_predicates.hvm.snap b/tests/snapshots/compile_file_o_all__sum_predicates.hvm.snap index 04660372d..652461fbf 100644 --- a/tests/snapshots/compile_file_o_all__sum_predicates.hvm.snap +++ b/tests/snapshots/compile_file_o_all__sum_predicates.hvm.snap @@ -4,7 +4,7 @@ input_file: tests/golden_tests/compile_file_o_all/sum_predicates.hvm --- @main = a & @sum_pred ~ (#8 (#5 a)) -@sum_pred = (?<(@sum_pred$C0 @sum_pred$C2) a> a) -@sum_pred$C0 = (?<(#0 (a a)) b> b) +@sum_pred = (?<@sum_pred$C0 @sum_pred$C2 a> a) +@sum_pred$C0 = (?<#0 (a a) b> b) @sum_pred$C1 = (a (<+ a b> b)) -@sum_pred$C2 = (a (?<((b b) @sum_pred$C1) (a c)> c)) +@sum_pred$C2 = (a (?<(b b) @sum_pred$C1 (a c)> c)) diff --git a/tests/snapshots/compile_term__match.hvm.snap b/tests/snapshots/compile_term__match.hvm.snap index 6b01118e6..fea10a006 100644 --- a/tests/snapshots/compile_term__match.hvm.snap +++ b/tests/snapshots/compile_term__match.hvm.snap @@ -3,4 +3,4 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/compile_term/match.hvm --- a -& #0 ~ <+ #1 ?<((b (* b)) (* (* (c c)))) a>> +& #0 ~ <+ #1 ?<(b (* b)) (* (* (c c))) a>> diff --git a/tests/snapshots/readback_lnet__invalid_mat_mat.hvm.snap b/tests/snapshots/readback_lnet__invalid_mat_mat.hvm.snap index 8fb00e8fb..46fa00834 100644 --- a/tests/snapshots/readback_lnet__invalid_mat_mat.hvm.snap +++ b/tests/snapshots/readback_lnet__invalid_mat_mat.hvm.snap @@ -2,8 +2,5 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/readback_lnet/invalid_mat_mat.hvm --- -Warnings: -During readback: - Invalid Numeric Match. (4 occurrences) - -λa match match { 0: 3; 1+*: 4 } { 0: ; 1+: } +Errors: +invalid legacy match