From abf25d648db73f1e11b539d3f3a7dc3b17e215be Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 12 May 2018 12:58:57 -0700 Subject: [PATCH] Change repl behavior of strings --- schala-lang/src/eval.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schala-lang/src/eval.rs b/schala-lang/src/eval.rs index 08e7177..34f4252 100644 --- a/schala-lang/src/eval.rs +++ b/schala-lang/src/eval.rs @@ -291,7 +291,7 @@ impl Expr { Int(i) => format!("{}", i), Float(f) => format!("{}", f), Bool(b) => format!("{}", b), - StringLit(s) => format!("{}", s), + StringLit(s) => format!("\"{}\"", s), }, Expr::Func(f) => match f { BuiltIn(name) => format!("", name), @@ -486,5 +486,6 @@ mod eval_tests { fresh_env!("1 + 2", "3"); fresh_env!("var a = 1; a = 2", "Unit"); fresh_env!("var a = 1; a = 2; a", "2"); + fresh_env!(r#"("a", 1 + 2)"#, r#"("a", 3)"#); } }