fix signed parsing
This commit is contained in:
parent
8e0e1dcca5
commit
0ae1bdb3e7
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue