diff options
author | Josh Mcguigan <[email protected]> | 2020-04-01 12:47:41 +0100 |
---|---|---|
committer | Josh Mcguigan <[email protected]> | 2020-04-01 12:47:41 +0100 |
commit | d0b6b2ee2f4a447f4c3827f87ebaf5216de6f226 (patch) | |
tree | daff375343f22ac3be457ab01c51f070a25b5b25 /crates/ra_syntax/src | |
parent | 67351a011bbaf63617c7fc96884129e9fc39e411 (diff) |
lower bool literal with the value from source code rather than default bool value
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/expr_extensions.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 77cceb382..8bbd946c0 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -308,7 +308,7 @@ pub enum LiteralKind { | |||
308 | Byte, | 308 | Byte, |
309 | IntNumber { suffix: Option<SmolStr> }, | 309 | IntNumber { suffix: Option<SmolStr> }, |
310 | FloatNumber { suffix: Option<SmolStr> }, | 310 | FloatNumber { suffix: Option<SmolStr> }, |
311 | Bool, | 311 | Bool(bool), |
312 | } | 312 | } |
313 | 313 | ||
314 | impl ast::Literal { | 314 | impl ast::Literal { |
@@ -355,7 +355,8 @@ impl ast::Literal { | |||
355 | LiteralKind::FloatNumber { suffix: Self::find_suffix(&text, &FLOAT_SUFFIXES) } | 355 | LiteralKind::FloatNumber { suffix: Self::find_suffix(&text, &FLOAT_SUFFIXES) } |
356 | } | 356 | } |
357 | STRING | RAW_STRING => LiteralKind::String, | 357 | STRING | RAW_STRING => LiteralKind::String, |
358 | T![true] | T![false] => LiteralKind::Bool, | 358 | T![true] => LiteralKind::Bool(true), |
359 | T![false] => LiteralKind::Bool(false), | ||
359 | BYTE_STRING | RAW_BYTE_STRING => LiteralKind::ByteString, | 360 | BYTE_STRING | RAW_BYTE_STRING => LiteralKind::ByteString, |
360 | CHAR => LiteralKind::Char, | 361 | CHAR => LiteralKind::Char, |
361 | BYTE => LiteralKind::Byte, | 362 | BYTE => LiteralKind::Byte, |