mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
pretty error messages for integers
This commit is contained in:
parent
308a24b080
commit
9d67b11c0d
10 changed files with 342 additions and 87 deletions
|
@ -100,13 +100,12 @@ pub fn fmt_expr<'a>(
|
|||
buf.push('-');
|
||||
}
|
||||
|
||||
buf.push('0');
|
||||
|
||||
buf.push(match base {
|
||||
Base::Hex => 'x',
|
||||
Base::Octal => 'o',
|
||||
Base::Binary => 'b',
|
||||
});
|
||||
match base {
|
||||
Base::Hex => buf.push_str("0x"),
|
||||
Base::Octal => buf.push_str("0o"),
|
||||
Base::Binary => buf.push_str("0b"),
|
||||
Base::Decimal => { /* nothing */ }
|
||||
}
|
||||
|
||||
buf.push_str(string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue