Trim newline in getline()

Ineffiicent but whatever
This commit is contained in:
greg 2018-05-12 14:00:48 -07:00
parent 6bf106a1a3
commit ac576be604
1 changed files with 1 additions and 1 deletions

View File

@ -454,7 +454,7 @@ impl<'a> State<'a> {
("getline", &[]) => {
let mut buf = String::new();
io::stdin().read_line(&mut buf).expect("Error readling line in 'getline'");
Lit(StringLit(Rc::new(buf)))
Lit(StringLit(Rc::new(buf.trim().to_string())))
},
(x, args) => return Err(format!("bad or unimplemented builtin {:?} | {:?}", x, args)),
})