Fix string and list readback

This commit is contained in:
imaqtkatt 2024-05-27 15:50:06 -03:00
parent b74c3e2693
commit 053c7a5817
29 changed files with 44 additions and 39 deletions

View File

@ -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";

View File

@ -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<Box<Term>>) -> Result<Vec<Bo
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 {
// New list element, append and recurse
l.push(std::mem::take(head));
let l = build_list_num_scott(tail, l);

View File

@ -1,7 +1,5 @@
use builtins::SCONS_TAG;
use crate::{
fun::{builtins, Num, Pattern, Tag, Term},
fun::{builtins, Name, Num, Pattern, Tag, Term},
maybe_grow, AdtEncoding,
};
@ -34,9 +32,10 @@ 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(SCONS_TAG) } = arg.as_mut() {
// if let Term::Num { val: Num::U24(SCONS_TAG) } = arg.as_mut() {
if let Term::Ref { nam: Name(nam) } = arg.as_mut() {
if let Term::Num { val: Num::U24(head) } = head.as_mut() {
if var_lam == var_app {
if var_lam == var_app && nam == builtins::SCONS_TAG_REF {
let head = char::from_u32(*head).unwrap_or(char::REPLACEMENT_CHARACTER);
if let Some(str) = build_string_num_scott(tail, head.to_string()) {
*self = Term::str(&str);
@ -154,9 +153,10 @@ fn build_string_num_scott(term: &Term, mut s: String) -> Option<String> {
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);

View File

@ -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";
}

View File

@ -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]

View File

@ -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]

View File

@ -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]

View File

@ -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"

View File

@ -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]

View File

@ -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}\\"

View File

@ -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]

View File

@ -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"

View File

@ -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"

View File

@ -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]

View File

@ -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]

View File

@ -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]]

View File

@ -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]

View File

@ -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"}

View File

@ -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 {"(+" *})

View File

@ -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]}

View File

@ -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]]

View File

@ -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]

View File

@ -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")))]

View File

@ -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" "")))))

View File

@ -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]

View File

@ -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])))

View File

@ -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"

View File

@ -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}

View File

@ -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:
"🌎"