syntax: Treat error literals in more principled way

This commit is contained in:
Vadim Petrochenkov 2019-06-07 12:53:33 +03:00
parent c1c60d292e
commit 2af47facc3
11 changed files with 33 additions and 27 deletions

View file

@ -1368,7 +1368,7 @@ pub enum LitKind {
FloatUnsuffixed(Symbol),
/// A boolean literal.
Bool(bool),
/// A recovered character literal that contains mutliple `char`s, most likely a typo.
/// Placeholder for a literal that wasn't well-formed in some way.
Err(Symbol),
}
@ -1406,10 +1406,10 @@ impl LitKind {
| LitKind::ByteStr(..)
| LitKind::Byte(..)
| LitKind::Char(..)
| LitKind::Err(..)
| LitKind::Int(_, LitIntType::Unsuffixed)
| LitKind::FloatUnsuffixed(..)
| LitKind::Bool(..) => true,
| LitKind::Bool(..)
| LitKind::Err(..) => true,
// suffixed variants
LitKind::Int(_, LitIntType::Signed(..))
| LitKind::Int(_, LitIntType::Unsigned(..))