mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:51:16 +01:00
Switch radix to an enum for easier formatting (#1130)
Note the use of an enum allows for the operator to be defined for formatting. This reduces the custom formatting required, which is a simplification carrying over to error handling changes I'm working on too. Also, I kind of feel the code's now clearer about what's supported; I'm dropping CHECKs that seemed redundant with the enum.
This commit is contained in:
@@ -252,7 +252,7 @@ class TokenizedBuffer::Lexer {
|
||||
buffer_.literal_int_storage_.push_back(std::move(value.mantissa));
|
||||
buffer_.literal_int_storage_.push_back(std::move(value.exponent));
|
||||
CHECK(buffer_.GetRealLiteral(token).IsDecimal() ==
|
||||
(value.radix == 10));
|
||||
(value.radix == LexedNumericLiteral::Radix::Decimal));
|
||||
return token;
|
||||
},
|
||||
[&](LexedNumericLiteral::UnrecoverableError) {
|
||||
|
||||
Reference in New Issue
Block a user