mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
Compare commits
No commits in common. "0e992d9324f797241bb3c8017b96908aac21ac36" and "9d10030c4704c5c51e2a5903c8c9c478d5747daa" have entirely different histories.
0e992d9324
...
9d10030c47
|
@ -1,12 +1,9 @@
|
||||||
let foo = if 1 == 1 then
|
let foo = 1 + 1;
|
||||||
5
|
|
||||||
else
|
|
||||||
10
|
|
||||||
end;
|
|
||||||
|
|
||||||
do
|
if foo == 2 then
|
||||||
print(1);
|
do
|
||||||
end;
|
foo + 1;
|
||||||
|
end
|
||||||
fun bar a b = a + b;
|
else
|
||||||
let baz = bar(34 35);
|
foo - 1;
|
||||||
|
end;
|
|
@ -323,9 +323,9 @@ impl Expr {
|
||||||
&format!("({} {})", name.to_sexpr(), args.iter().map(|x| x.to_sexpr()).collect::<Vec<_>>().join(" "))),
|
&format!("({} {})", name.to_sexpr(), args.iter().map(|x| x.to_sexpr()).collect::<Vec<_>>().join(" "))),
|
||||||
|
|
||||||
Self::Let{ name, value } => out.push_str(
|
Self::Let{ name, value } => out.push_str(
|
||||||
&format!("(let {}\n {})", name, value.clone().to_sexpr())),
|
&format!("(let\n {}\n {})", name, value.clone().to_sexpr())),
|
||||||
Self::Fun{ name, args, body } => out.push_str(
|
Self::Fun{ name, args, body } => out.push_str(
|
||||||
&format!("(fun {} ({})\n {})", name, args.join(" "), body.to_sexpr())),
|
&format!("(fun\n ({})\n {}\n {})", name, args.join(" "), body.to_sexpr())),
|
||||||
|
|
||||||
Self::If { cond, then, else_ } => out.push_str(
|
Self::If { cond, then, else_ } => out.push_str(
|
||||||
&format!("(if {}\n {}\n {})", cond.to_sexpr(), then.to_sexpr(), else_.to_sexpr())),
|
&format!("(if {}\n {}\n {})", cond.to_sexpr(), then.to_sexpr(), else_.to_sexpr())),
|
||||||
|
|
Loading…
Reference in a new issue