fix signed parsing

This commit is contained in:
mos 2024-07-27 17:00:29 +02:00
parent 8e0e1dcca5
commit 0ae1bdb3e7
1 changed files with 1 additions and 3 deletions

View File

@ -112,12 +112,10 @@ impl Symbol {
let v = Symbol::take(&mut it, |c| c.is_numeric());
if let Ok(n) = v.iter().collect::<String>().parse::<u64>() {
let n = (n as i64 * sign) as u64;
syms.push(if sign > 0 {
Self::Int(n)
} else {
Self::SInt(n)
Self::SInt((n as i64 * sign) as u64)
});
} else {
return Err("invalid integer".to_string());