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

View File

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