diff --git a/src/fun/builtins.rs b/src/fun/builtins.rs index 59fcb9b8..48bfcbdf 100644 --- a/src/fun/builtins.rs +++ b/src/fun/builtins.rs @@ -7,6 +7,8 @@ pub const LIST: &str = "List"; pub const LCONS: &str = "List/Cons"; pub const LNIL: &str = "List/Nil"; pub const LCONS_TAG: u32 = 1; +pub const LNIL_TAG_REF: &str = "List/Nil/tag"; +pub const LCONS_TAG_REF: &str = "List/Cons/tag"; pub const HEAD: &str = "head"; pub const TAIL: &str = "tail"; @@ -15,6 +17,8 @@ pub const STRING: &str = "String"; pub const SCONS: &str = "String/Cons"; pub const SNIL: &str = "String/Nil"; pub const SCONS_TAG: u32 = 1; +pub const SNIL_TAG_REF: &str = "String/Nil/tag"; +pub const SCONS_TAG_REF: &str = "String/Cons/tag"; pub const NAT: &str = "Nat"; pub const NAT_SUCC: &str = "Nat/Succ"; diff --git a/src/fun/transform/resugar_list.rs b/src/fun/transform/resugar_list.rs index 41f38c0a..afd491fb 100644 --- a/src/fun/transform/resugar_list.rs +++ b/src/fun/transform/resugar_list.rs @@ -1,8 +1,7 @@ use crate::{ - fun::{builtins, Num, Pattern, Tag, Term}, + fun::{builtins, Pattern, Tag, Term}, maybe_grow, AdtEncoding, }; -use builtins::LCONS_TAG; impl Term { /// Converts lambda-encoded lists ending with List/Nil to list literals. @@ -33,8 +32,9 @@ impl Term { if let Term::App { tag: Tag::Static, fun, arg: head } = fun.as_mut() { if let Term::App { tag: Tag::Static, fun, arg } = fun.as_mut() { if let Term::Var { nam: var_app } = fun.as_mut() { - if let Term::Num { val: Num::U24(LCONS_TAG) } = arg.as_mut() { - if var_lam == var_app { + if let Term::Ref { nam } = arg.as_mut() { + // if let Term::Num { val: Num::U24(LCONS_TAG) } = arg.as_mut() { + if var_lam == var_app && nam == builtins::LCONS_TAG_REF { let l = build_list_num_scott(tail.as_mut(), vec![std::mem::take(head)]); match l { Ok(l) => *self = Term::List { els: l.into_iter().map(|x| *x).collect() }, @@ -160,8 +160,9 @@ fn build_list_num_scott(term: &mut Term, mut l: Vec>) -> Result Option { if let Term::App { tag: Tag::Static, fun, arg: head } = fun.as_ref() { if let Term::App { tag: Tag::Static, fun, arg } = fun.as_ref() { if let Term::Var { nam: var_app } = fun.as_ref() { - if let Term::Num { val: Num::U24(SCONS_TAG) } = arg.as_ref() { + if let Term::Ref { nam } = arg.as_ref() { + // if let Term::Num { val: Num::U24(SCONS_TAG) } = arg.as_ref() { if let Term::Num { val: Num::U24(head) } = head.as_ref() { - if var_lam == var_app { + if var_lam == var_app && nam == builtins::SCONS_TAG_REF { // New string character, append and recurse let head = char::from_u32(*head).unwrap_or(char::REPLACEMENT_CHARACTER); s.push(head); diff --git a/tests/snapshots/cli__run_pretty.bend.snap b/tests/snapshots/cli__run_pretty.bend.snap index b906a8e4..ff7d1150 100644 --- a/tests/snapshots/cli__run_pretty.bend.snap +++ b/tests/snapshots/cli__run_pretty.bend.snap @@ -8,5 +8,5 @@ Result: 0: "ba"; _: λ* "ta"; }; - _: λ* λb (b String/Cons/tag 97 λc (c String/Cons/tag 116 λd (d String/Cons/tag 97 ""))); + _: λ* "ata"; } diff --git a/tests/snapshots/examples__insertion_sort.bend.snap b/tests/snapshots/examples__insertion_sort.bend.snap index eb3bdc0d..e6d0edc4 100644 --- a/tests/snapshots/examples__insertion_sort.bend.snap +++ b/tests/snapshots/examples__insertion_sort.bend.snap @@ -2,4 +2,4 @@ source: tests/golden_tests.rs input_file: examples/insertion_sort.bend --- -λa (a List/Cons/tag 4780 λb (b List/Cons/tag 11739 λc (c List/Cons/tag 35809 λd (d List/Cons/tag 49583 λe (e List/Cons/tag 154358 λf (f List/Cons/tag 177867 λg (g List/Cons/tag 244878 λh (h List/Cons/tag 289211 λi (i List/Cons/tag 318852 λj (j List/Cons/tag 423850 [])))))))))) +[4780, 11739, 35809, 49583, 154358, 177867, 244878, 289211, 318852, 423850] diff --git a/tests/snapshots/examples__queue.bend.snap b/tests/snapshots/examples__queue.bend.snap index cda80700..569ea985 100644 --- a/tests/snapshots/examples__queue.bend.snap +++ b/tests/snapshots/examples__queue.bend.snap @@ -2,4 +2,4 @@ source: tests/golden_tests.rs input_file: examples/queue.bend --- -λa (a List/Cons/tag 1 λb (b List/Cons/tag 2 λc (c List/Cons/tag 3 []))) +[1, 2, 3] diff --git a/tests/snapshots/run_file__basic_num_ops.bend.snap b/tests/snapshots/run_file__basic_num_ops.bend.snap index 9ae15ca5..fd68f633 100644 --- a/tests/snapshots/run_file__basic_num_ops.bend.snap +++ b/tests/snapshots/run_file__basic_num_ops.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/basic_num_ops.bend --- NumScott: -λa (a List/Cons/tag 30 λb (b List/Cons/tag 10 λc (c List/Cons/tag 200 λd (d List/Cons/tag 2 λe (e List/Cons/tag 0 λf (f List/Cons/tag 30 λg (g List/Cons/tag 0 λh (h List/Cons/tag 30 λi (i List/Cons/tag 0 λj (j List/Cons/tag 1 λk (k List/Cons/tag 0 λl (l List/Cons/tag 1 λm (m List/Cons/tag 65535 λn (n List/Cons/tag +30 λo (o List/Cons/tag +10 λp (p List/Cons/tag +200 λq (q List/Cons/tag +2 λr (r List/Cons/tag +0 λs (s List/Cons/tag +30 λt (t List/Cons/tag +0 λu (u List/Cons/tag +30 λv (v List/Cons/tag 0 λw (w List/Cons/tag 1 λx (x List/Cons/tag 0 λy (y List/Cons/tag 1 λz (z List/Cons/tag 65535 λab (ab List/Cons/tag -30 λbb (bb List/Cons/tag -10 λcb (cb List/Cons/tag +200 λdb (db List/Cons/tag +2 λeb (eb List/Cons/tag +0 λfb (fb List/Cons/tag +26 λgb (gb List/Cons/tag -28 λhb (hb List/Cons/tag -2 λib (ib List/Cons/tag 0 λjb (jb List/Cons/tag 1 λkb (kb List/Cons/tag 1 λlb (lb List/Cons/tag 0 λmb (mb List/Cons/tag 65535 λnb (nb List/Cons/tag +10 λob (ob List/Cons/tag +30 λpb (pb List/Cons/tag -200 λqb (qb List/Cons/tag -2 λrb (rb List/Cons/tag +0 λsb (sb List/Cons/tag -30 λtb (tb List/Cons/tag +20 λub (ub List/Cons/tag -10 λvb (vb List/Cons/tag 0 λwb (wb List/Cons/tag 1 λxb (xb List/Cons/tag 0 λyb (yb List/Cons/tag 1 λzb (zb List/Cons/tag 65535 λac (ac List/Cons/tag -10 λbc (bc List/Cons/tag -30 λcc (cc List/Cons/tag -200 λdc (dc List/Cons/tag -2 λec (ec List/Cons/tag +0 λfc (fc List/Cons/tag -26 λgc (gc List/Cons/tag +8 λhc (hc List/Cons/tag -18 λic (ic List/Cons/tag 0 λjc (jc List/Cons/tag 1 λkc (kc List/Cons/tag 1 λlc (lc List/Cons/tag 0 λmc (mc List/Cons/tag 65535 λnc (nc List/Cons/tag 30.000 λoc (oc List/Cons/tag 10.000 λpc (pc List/Cons/tag 200.000 λqc (qc List/Cons/tag 2.000 λrc (rc List/Cons/tag 0.000 λsc (sc List/Cons/tag 10240007340032.000 λtc (tc List/Cons/tag 1.107 λuc (uc List/Cons/tag 0.769 λvc (vc List/Cons/tag 0 λwc (wc List/Cons/tag 1 λxc (xc List/Cons/tag 0 λyc (yc List/Cons/tag 1 λzc (zc List/Cons/tag 65535 λad (ad List/Cons/tag -30.000 λbd (bd List/Cons/tag -10.000 λcd (cd List/Cons/tag 200.000 λdd (dd List/Cons/tag 2.000 λed (ed List/Cons/tag -0.000 λfd (fd List/Cons/tag 0.000 λgd (gd List/Cons/tag -2.034 λhd (hd List/Cons/tag NaN λid (id List/Cons/tag 0 λjd (jd List/Cons/tag 1 λkd (kd List/Cons/tag 1 λld (ld List/Cons/tag 0 λmd (md List/Cons/tag 65535 λnd (nd List/Cons/tag 10.000 λod (od List/Cons/tag 30.000 λpd (pd List/Cons/tag -200.000 λqd (qd List/Cons/tag -2.000 λrd (rd List/Cons/tag 0.000 λsd (sd List/Cons/tag 0.000 λtd (td List/Cons/tag 2.034 λud (ud List/Cons/tag NaN λvd (vd List/Cons/tag 0 λwd (wd List/Cons/tag 1 λxd (xd List/Cons/tag 0 λyd (yd List/Cons/tag 1 λzd (zd List/Cons/tag 65535 λae (ae List/Cons/tag -10.000 λbe (be List/Cons/tag -30.000 λce (ce List/Cons/tag -200.000 λde (de List/Cons/tag -2.000 λee (ee List/Cons/tag -0.000 λfe (fe List/Cons/tag 10240007340032.000 λge (ge List/Cons/tag -1.107 λhe (he List/Cons/tag NaN λie (ie List/Cons/tag 0 λje (je List/Cons/tag 1 λke (ke List/Cons/tag 1 λle (le List/Cons/tag 0 [])))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +[30, 10, 200, 2, 0, 30, 0, 30, 0, 1, 0, 1, 65535, +30, +10, +200, +2, +0, +30, +0, +30, 0, 1, 0, 1, 65535, -30, -10, +200, +2, +0, +26, -28, -2, 0, 1, 1, 0, 65535, +10, +30, -200, -2, +0, -30, +20, -10, 0, 1, 0, 1, 65535, -10, -30, -200, -2, +0, -26, +8, -18, 0, 1, 1, 0, 65535, 30.000, 10.000, 200.000, 2.000, 0.000, 10240007340032.000, 1.107, 0.769, 0, 1, 0, 1, 65535, -30.000, -10.000, 200.000, 2.000, -0.000, 0.000, -2.034, NaN, 0, 1, 1, 0, 65535, 10.000, 30.000, -200.000, -2.000, 0.000, 0.000, 2.034, NaN, 0, 1, 0, 1, 65535, -10.000, -30.000, -200.000, -2.000, -0.000, 10240007340032.000, -1.107, NaN, 0, 1, 1, 0] Scott: [30, 10, 200, 2, 0, 30, 0, 30, 0, 1, 0, 1, 65535, +30, +10, +200, +2, +0, +30, +0, +30, 0, 1, 0, 1, 65535, -30, -10, +200, +2, +0, +26, -28, -2, 0, 1, 1, 0, 65535, +10, +30, -200, -2, +0, -30, +20, -10, 0, 1, 0, 1, 65535, -10, -30, -200, -2, +0, -26, +8, -18, 0, 1, 1, 0, 65535, 30.000, 10.000, 200.000, 2.000, 0.000, 10240007340032.000, 1.107, 0.769, 0, 1, 0, 1, 65535, -30.000, -10.000, 200.000, 2.000, -0.000, 0.000, -2.034, NaN, 0, 1, 1, 0, 65535, 10.000, 30.000, -200.000, -2.000, 0.000, 0.000, 2.034, NaN, 0, 1, 0, 1, 65535, -10.000, -30.000, -200.000, -2.000, -0.000, 10240007340032.000, -1.107, NaN, 0, 1, 1, 0] diff --git a/tests/snapshots/run_file__chars.bend.snap b/tests/snapshots/run_file__chars.bend.snap index 29f7e712..41ab9ca2 100644 --- a/tests/snapshots/run_file__chars.bend.snap +++ b/tests/snapshots/run_file__chars.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/chars.bend --- NumScott: -λa (a String/Cons/tag 4660 λb (b String/Cons/tag 33 λc (c String/Cons/tag 55 ""))) +"ሴ!7" Scott: "ሴ!7" diff --git a/tests/snapshots/run_file__comprehension.bend.snap b/tests/snapshots/run_file__comprehension.bend.snap index 37d449ac..0a147d9e 100644 --- a/tests/snapshots/run_file__comprehension.bend.snap +++ b/tests/snapshots/run_file__comprehension.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/comprehension.bend --- NumScott: -λa (a List/Cons/tag 5 λb (b List/Cons/tag 10 λc (c List/Cons/tag 7 λd (d List/Cons/tag 6 [])))) +[5, 10, 7, 6] Scott: [5, 10, 7, 6] diff --git a/tests/snapshots/run_file__escape_sequences.bend.snap b/tests/snapshots/run_file__escape_sequences.bend.snap index 29d1df52..74193078 100644 --- a/tests/snapshots/run_file__escape_sequences.bend.snap +++ b/tests/snapshots/run_file__escape_sequences.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/escape_sequences.bend --- NumScott: -λa (a String/Cons/tag 10 λb (b String/Cons/tag 13 λc (c String/Cons/tag 9 λd (d String/Cons/tag 0 λe (e String/Cons/tag 34 λf (f String/Cons/tag 39 λg (g String/Cons/tag 2814 λh (h String/Cons/tag 92 λi (i String/Cons/tag 10 λj (j String/Cons/tag 13 λk (k String/Cons/tag 9 λl (l String/Cons/tag 0 λm (m String/Cons/tag 34 λn (n String/Cons/tag 39 λo (o String/Cons/tag 2814 λp (p String/Cons/tag 92 "")))))))))))))))) +"\n\r\t\0\"'\u{afe}\\\n\r\t\0\"'\u{afe}\\" Scott: "\n\r\t\0\"'\u{afe}\\\n\r\t\0\"'\u{afe}\\" diff --git a/tests/snapshots/run_file__fold_with_state.bend.snap b/tests/snapshots/run_file__fold_with_state.bend.snap index 614df968..6744b2ea 100644 --- a/tests/snapshots/run_file__fold_with_state.bend.snap +++ b/tests/snapshots/run_file__fold_with_state.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/fold_with_state.bend --- NumScott: -λa (a List/Cons/tag 1 λb (b List/Cons/tag 2 λc (c List/Cons/tag 3 []))) +[1, 2, 3] Scott: [1, 2, 3] diff --git a/tests/snapshots/run_file__guide_if_age.bend.snap b/tests/snapshots/run_file__guide_if_age.bend.snap index 05f51af9..e37e24d9 100644 --- a/tests/snapshots/run_file__guide_if_age.bend.snap +++ b/tests/snapshots/run_file__guide_if_age.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/guide_if_age.bend --- NumScott: -λa (a String/Cons/tag 121 λb (b String/Cons/tag 111 λc (c String/Cons/tag 117 λd (d String/Cons/tag 39 λe (e String/Cons/tag 114 λf (f String/Cons/tag 101 λg (g String/Cons/tag 32 λh (h String/Cons/tag 97 λi (i String/Cons/tag 110 λj (j String/Cons/tag 32 λk (k String/Cons/tag 97 λl (l String/Cons/tag 100 λm (m String/Cons/tag 117 λn (n String/Cons/tag 108 λo (o String/Cons/tag 116 ""))))))))))))))) +"you're an adult" Scott: "you're an adult" diff --git a/tests/snapshots/run_file__guide_is_even_str.bend.snap b/tests/snapshots/run_file__guide_is_even_str.bend.snap index 800daa74..3f40f32d 100644 --- a/tests/snapshots/run_file__guide_is_even_str.bend.snap +++ b/tests/snapshots/run_file__guide_is_even_str.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/guide_is_even_str.bend --- NumScott: -λa (a String/Cons/tag 111 λb (b String/Cons/tag 100 λc (c String/Cons/tag 100 ""))) +"odd" Scott: "odd" diff --git a/tests/snapshots/run_file__guide_list_ctrs.bend.snap b/tests/snapshots/run_file__guide_list_ctrs.bend.snap index 999830ce..34adaf9e 100644 --- a/tests/snapshots/run_file__guide_list_ctrs.bend.snap +++ b/tests/snapshots/run_file__guide_list_ctrs.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/guide_list_ctrs.bend --- NumScott: -λa (a List/Cons/tag 1 λb (b List/Cons/tag 2 λc (c List/Cons/tag 3 []))) +[1, 2, 3] Scott: [1, 2, 3] diff --git a/tests/snapshots/run_file__guide_list_sugar.bend.snap b/tests/snapshots/run_file__guide_list_sugar.bend.snap index cc14d0e6..e7e1899f 100644 --- a/tests/snapshots/run_file__guide_list_sugar.bend.snap +++ b/tests/snapshots/run_file__guide_list_sugar.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/guide_list_sugar.bend --- NumScott: -λa (a List/Cons/tag 1 λb (b List/Cons/tag 2 λc (c List/Cons/tag 3 []))) +[1, 2, 3] Scott: [1, 2, 3] diff --git a/tests/snapshots/run_file__list_resugar.bend.snap b/tests/snapshots/run_file__list_resugar.bend.snap index 23c1cadb..05fa4972 100644 --- a/tests/snapshots/run_file__list_resugar.bend.snap +++ b/tests/snapshots/run_file__list_resugar.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/list_resugar.bend --- NumScott: -λa (a List/Cons/tag 42 λb (b List/Cons/tag λc (c List/Cons/tag λd d []) [])) +[42, [λd d]] Scott: [42, [λd d]] diff --git a/tests/snapshots/run_file__list_take.bend.snap b/tests/snapshots/run_file__list_take.bend.snap index f6d3ee72..10bb924b 100644 --- a/tests/snapshots/run_file__list_take.bend.snap +++ b/tests/snapshots/run_file__list_take.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/list_take.bend --- NumScott: -λa (a List/Cons/tag 3 λb (b List/Cons/tag 2 [])) +[3, 2] Scott: [3, 2] diff --git a/tests/snapshots/run_file__match_builtins.bend.snap b/tests/snapshots/run_file__match_builtins.bend.snap index 8d95d135..57669dc5 100644 --- a/tests/snapshots/run_file__match_builtins.bend.snap +++ b/tests/snapshots/run_file__match_builtins.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/match_builtins.bend --- NumScott: -{λa (a String/Cons/tag 101 λb (b String/Cons/tag 108 λc (c String/Cons/tag 108 λd (d String/Cons/tag 111 "")))) λe (e String/Cons/tag 119 λf (f String/Cons/tag 111 λg (g String/Cons/tag 114 λh (h String/Cons/tag 108 λi (i String/Cons/tag 100 "")))))} +{"ello" "world"} Scott: {"ello" "world"} diff --git a/tests/snapshots/run_file__match_num_adt_tup_parser.bend.snap b/tests/snapshots/run_file__match_num_adt_tup_parser.bend.snap index 89fbda23..e14fe584 100644 --- a/tests/snapshots/run_file__match_num_adt_tup_parser.bend.snap +++ b/tests/snapshots/run_file__match_num_adt_tup_parser.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/match_num_adt_tup_parser.bend --- NumScott: -λa (a Result_/Err/tag {λb (b String/Cons/tag 40 λc (c String/Cons/tag 43 "")) *}) +λa (a Result_/Err/tag {"(+" *}) Scott: λ* λa (a {"(+" *}) diff --git a/tests/snapshots/run_file__match_num_num_to_char.bend.snap b/tests/snapshots/run_file__match_num_num_to_char.bend.snap index 30c3c84f..c55898b1 100644 --- a/tests/snapshots/run_file__match_num_num_to_char.bend.snap +++ b/tests/snapshots/run_file__match_num_num_to_char.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/match_num_num_to_char.bend --- NumScott: -{{λa (a List/Cons/tag 0 λb (b List/Cons/tag 1 λc (c List/Cons/tag 2 λd (d List/Cons/tag 3 λe (e List/Cons/tag 4 λf (f List/Cons/tag 5 λg (g List/Cons/tag 6 λh (h List/Cons/tag 7 λi (i List/Cons/tag 8 λj (j List/Cons/tag 9 λk (k List/Cons/tag 10 []))))))))))) λl (l List/Cons/tag 0 λm (m List/Cons/tag 1 λn (n List/Cons/tag 2 λo (o List/Cons/tag 3 λp (p List/Cons/tag 4 λq (q List/Cons/tag 5 λr (r List/Cons/tag 6 λs (s List/Cons/tag 7 λt (t List/Cons/tag 8 λu (u List/Cons/tag 9 λv (v List/Cons/tag 16777215 [])))))))))))} λw (w List/Cons/tag 48 λx (x List/Cons/tag 49 λy (y List/Cons/tag 50 λz (z List/Cons/tag 51 λab (ab List/Cons/tag 52 λbb (bb List/Cons/tag 53 λcb (cb List/Cons/tag 54 λdb (db List/Cons/tag 55 λeb (eb List/Cons/tag 56 λfb (fb List/Cons/tag 57 λgb (gb List/Cons/tag 0 [])))))))))))} +{{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16777215]} [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0]} Scott: {{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16777215]} [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 0]} diff --git a/tests/snapshots/run_file__match_num_succ_complex.bend.snap b/tests/snapshots/run_file__match_num_succ_complex.bend.snap index 63750c27..3bb1042d 100644 --- a/tests/snapshots/run_file__match_num_succ_complex.bend.snap +++ b/tests/snapshots/run_file__match_num_succ_complex.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/match_num_succ_complex.bend --- NumScott: -λa (a List/Cons/tag λb (b List/Cons/tag 5 λc (c List/Cons/tag 5 λd (d List/Cons/tag 0 λe (e List/Cons/tag 12 λf (f List/Cons/tag 0 λg (g List/Cons/tag 6 [])))))) λh (h List/Cons/tag λi (i List/Cons/tag 5 λj (j List/Cons/tag 5 λk (k List/Cons/tag 0 λl (l List/Cons/tag 12 λm (m List/Cons/tag 0 λn (n List/Cons/tag 6 [])))))) [])) +[[5, 5, 0, 12, 0, 6], [5, 5, 0, 12, 0, 6]] Scott: [[5, 5, 0, 12, 0, 6], [5, 5, 0, 12, 0, 6]] diff --git a/tests/snapshots/run_file__match_str.bend.snap b/tests/snapshots/run_file__match_str.bend.snap index aee72cc2..f58e07d9 100644 --- a/tests/snapshots/run_file__match_str.bend.snap +++ b/tests/snapshots/run_file__match_str.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/match_str.bend --- NumScott: -λa (a List/Cons/tag 2 λb (b List/Cons/tag 2 λc (c List/Cons/tag 1 λd (d List/Cons/tag 0 λe (e List/Cons/tag 0 λf (f List/Cons/tag 0 [])))))) +[2, 2, 1, 0, 0, 0] Scott: [2, 2, 1, 0, 0, 0] diff --git a/tests/snapshots/run_file__nested_list_and_string.bend.snap b/tests/snapshots/run_file__nested_list_and_string.bend.snap index 956b7709..53b1523f 100644 --- a/tests/snapshots/run_file__nested_list_and_string.bend.snap +++ b/tests/snapshots/run_file__nested_list_and_string.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/nested_list_and_string.bend --- NumScott: -λa λb (b List/Cons/tag a λc (c List/Cons/tag λ* 2 λd (d List/Cons/tag λe (e String/Cons/tag λf (f List/Cons/tag 7 λg (g List/Cons/tag λh (h String/Cons/tag 49 λi (i String/Cons/tag 50 λj (j String/Cons/tag 51 λk (k String/Cons/tag 52 "")))) λl (l List/Cons/tag 9 []))) λm (m String/Cons/tag a λn (n String/Cons/tag * λo (o String/Cons/tag 52 λp (p String/Cons/tag 50 ""))))) []))) +λa [a, λ* 2, λe (e String/Cons/tag [7, "1234", 9] λm (m String/Cons/tag a λn (n String/Cons/tag * "42")))] Scott: λa [a, λ* 2, λ* λe (e [7, "1234", 9] λ* λm (m a λ* λn (n * "42")))] diff --git a/tests/snapshots/run_file__nested_str.bend.snap b/tests/snapshots/run_file__nested_str.bend.snap index 21f71d9c..4f8efaea 100644 --- a/tests/snapshots/run_file__nested_str.bend.snap +++ b/tests/snapshots/run_file__nested_str.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/nested_str.bend --- NumScott: -(λa (a String/Cons/tag λb (b String/Cons/tag 97 "") ""), (λc (c String/Cons/tag 97 λd (d String/Cons/tag λe (e String/Cons/tag 98 λf (f String/Cons/tag 99 "")) "")), (λg (g String/Cons/tag λh (h String/Cons/tag 97 λi (i String/Cons/tag 98 "")) λj (j String/Cons/tag 99 "")), λk (k String/Cons/tag λl (l String/Cons/tag 97 λm (m String/Cons/tag 98 "")) λn (n String/Cons/tag λo (o String/Cons/tag 99 λp (p String/Cons/tag 100 "")) ""))))) +(λa (a String/Cons/tag "a" ""), (λc (c String/Cons/tag 97 λd (d String/Cons/tag "bc" "")), (λg (g String/Cons/tag "ab" "c"), λk (k String/Cons/tag "ab" λn (n String/Cons/tag "cd" ""))))) Scott: (λ* λa (a "a" ""), (λ* λc (c 97 λ* λd (d "bc" "")), (λ* λg (g "ab" "c"), λ* λk (k "ab" λ* λn (n "cd" ""))))) diff --git a/tests/snapshots/run_file__ops.bend.snap b/tests/snapshots/run_file__ops.bend.snap index 4d0c19bb..961c54e6 100644 --- a/tests/snapshots/run_file__ops.bend.snap +++ b/tests/snapshots/run_file__ops.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/ops.bend --- NumScott: -λa (a List/Cons/tag 1 λb (b List/Cons/tag 1 λc (c List/Cons/tag 1 λd (d List/Cons/tag 1 λe (e List/Cons/tag 1 []))))) +[1, 1, 1, 1, 1] Scott: [1, 1, 1, 1, 1] diff --git a/tests/snapshots/run_file__readback_list_other_ctr.bend.snap b/tests/snapshots/run_file__readback_list_other_ctr.bend.snap index 8b03506b..548ae9bf 100644 --- a/tests/snapshots/run_file__readback_list_other_ctr.bend.snap +++ b/tests/snapshots/run_file__readback_list_other_ctr.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/readback_list_other_ctr.bend --- NumScott: -λa (a List/Cons/tag λb (b String/Cons/tag 97 λc (c tup/pair/tag 98 λd (d String/Cons/tag 99 ""))) λe (e List/Cons/tag 1 λf (f tup/pair/tag 2 λg (g List/Cons/tag 3 λh (h List/Cons/tag 4 []))))) +λa (a List/Cons/tag λb (b String/Cons/tag 97 λc (c tup/pair/tag 98 "c")) λe (e List/Cons/tag 1 λf (f tup/pair/tag 2 [3, 4]))) Scott: λ* λa (a λ* λb (b 97 λc (c 98 "c")) λ* λe (e 1 λf (f 2 [3, 4]))) diff --git a/tests/snapshots/run_file__str_concat.bend.snap b/tests/snapshots/run_file__str_concat.bend.snap index b91e1269..cd356fc6 100644 --- a/tests/snapshots/run_file__str_concat.bend.snap +++ b/tests/snapshots/run_file__str_concat.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/str_concat.bend --- NumScott: -λa (a String/Cons/tag 104 λb (b String/Cons/tag 101 λc (c String/Cons/tag 108 λd (d String/Cons/tag 108 λe (e String/Cons/tag 111 λf (f String/Cons/tag 32 λg (g String/Cons/tag 119 λh (h String/Cons/tag 111 λi (i String/Cons/tag 114 λj (j String/Cons/tag 108 λk (k String/Cons/tag 100 ""))))))))))) +"hello world" Scott: "hello world" diff --git a/tests/snapshots/run_file__tup_list_strings.bend.snap b/tests/snapshots/run_file__tup_list_strings.bend.snap index 2050ac28..0c54944e 100644 --- a/tests/snapshots/run_file__tup_list_strings.bend.snap +++ b/tests/snapshots/run_file__tup_list_strings.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/tup_list_strings.bend --- NumScott: -{λa (a List/Cons/tag {λb (b String/Cons/tag 102 λc (c String/Cons/tag 111 λd (d String/Cons/tag 111 ""))) 0} λe (e List/Cons/tag {λf (f String/Cons/tag 102 λg (g String/Cons/tag 111 λh (h String/Cons/tag 111 ""))) 0} λi (i List/Cons/tag {λj (j String/Cons/tag 102 λk (k String/Cons/tag 111 λl (l String/Cons/tag 111 ""))) 1} []))) 4} +{[{"foo" 0}, {"foo" 0}, {"foo" 1}] 4} Scott: {[{"foo" 0}, {"foo" 0}, {"foo" 1}] 4} diff --git a/tests/snapshots/run_file__world.bend.snap b/tests/snapshots/run_file__world.bend.snap index 610c98a7..0ed7518e 100644 --- a/tests/snapshots/run_file__world.bend.snap +++ b/tests/snapshots/run_file__world.bend.snap @@ -3,7 +3,7 @@ source: tests/golden_tests.rs input_file: tests/golden_tests/run_file/world.bend --- NumScott: -λa (a String/Cons/tag 127758 "") +"🌎" Scott: "🌎"