Skip to content

Commit 20d6149

Browse files
committed
letrec is no more a keyword; edit test
1 parent bd990d3 commit 20d6149

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/lang/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn sat<F: Fn(String) -> bool + 'static>(f: F) -> Parser<String> {
6262
})
6363
}
6464

65-
const KEYWORDS: [&'static str; 6] = ["let", "letrec", "case", "in", "of", "Pack"];
65+
const KEYWORDS: [&'static str; 5] = ["let", "case", "in", "of", "Pack"];
6666

6767
fn num() -> Parser<u32> {
6868
apply(

src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn nested_let() {
125125
#[test]
126126
fn letrec() {
127127
let res = compiler::eval(compiler::compile(lang::parse_raw(String::from(
128-
"pair x y f = f x y; fst p = p K; snd p = p K1; f x y = letrec a = pair x b; b = pair y a in fst (snd (snd (snd a))); main = f 3 4",
128+
"pair x y f = f x y; fst p = p K; snd p = p K1; f x y = let a = pair x b; b = pair y a in fst (snd (snd (snd a))); main = f 3 4",
129129
))));
130130
let res_stack = compiler::get_stack_results(res.last().expect("Empty states"));
131131
assert_eq!(res_stack, vec![compiler::Node::Num(4)])

0 commit comments

Comments
 (0)