rpn(1): fixed expressions on one line

This commit is contained in:
Emma Tebibyte 2024-02-02 19:13:53 -07:00
parent fb2a164507
commit 6f98fdd1d4
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -138,6 +138,7 @@ fn eval(
// Split the input into tokens. // Split the input into tokens.
let mut toks: VecDeque<CalcType> = input let mut toks: VecDeque<CalcType> = input
.split(' ') .split(' ')
.rev()
.map(|t| CalcType::from(t)) .map(|t| CalcType::from(t))
.collect(); .collect();
let mut ops: VecDeque<CalcType> = VecDeque::new(); let mut ops: VecDeque<CalcType> = VecDeque::new();