aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/expr_extensions.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-04-02 10:48:14 +0100
committerAleksey Kladov <[email protected]>2019-04-02 10:53:44 +0100
commit0e1e40676a82af782da2593c258c9af52ab78757 (patch)
tree335e06b2099a405ee11303e60e4922135762a357 /crates/ra_syntax/src/ast/expr_extensions.rs
parentcb5001c0a5ddadccd18fe787d89de3d6c3c8147f (diff)
rename flavor to kind
Diffstat (limited to 'crates/ra_syntax/src/ast/expr_extensions.rs')
-rw-r--r--crates/ra_syntax/src/ast/expr_extensions.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs
index ddc26206f..b24f86cec 100644
--- a/crates/ra_syntax/src/ast/expr_extensions.rs
+++ b/crates/ra_syntax/src/ast/expr_extensions.rs
@@ -192,7 +192,7 @@ impl ast::BinExpr {
192} 192}
193 193
194#[derive(Clone, Debug, PartialEq, Eq, Hash)] 194#[derive(Clone, Debug, PartialEq, Eq, Hash)]
195pub enum LiteralFlavor { 195pub enum LiteralKind {
196 String, 196 String,
197 ByteString, 197 ByteString,
198 Char, 198 Char,
@@ -210,7 +210,7 @@ impl ast::Literal {
210 } 210 }
211 } 211 }
212 212
213 pub fn flavor(&self) -> LiteralFlavor { 213 pub fn kind(&self) -> LiteralKind {
214 match self.token().kind() { 214 match self.token().kind() {
215 INT_NUMBER => { 215 INT_NUMBER => {
216 let allowed_suffix_list = [ 216 let allowed_suffix_list = [
@@ -222,7 +222,7 @@ impl ast::Literal {
222 .iter() 222 .iter()
223 .find(|&s| text.ends_with(s)) 223 .find(|&s| text.ends_with(s))
224 .map(|&suf| SmolStr::new(suf)); 224 .map(|&suf| SmolStr::new(suf));
225 LiteralFlavor::IntNumber { suffix } 225 LiteralKind::IntNumber { suffix }
226 } 226 }
227 FLOAT_NUMBER => { 227 FLOAT_NUMBER => {
228 let allowed_suffix_list = ["f64", "f32"]; 228 let allowed_suffix_list = ["f64", "f32"];
@@ -231,13 +231,13 @@ impl ast::Literal {
231 .iter() 231 .iter()
232 .find(|&s| text.ends_with(s)) 232 .find(|&s| text.ends_with(s))
233 .map(|&suf| SmolStr::new(suf)); 233 .map(|&suf| SmolStr::new(suf));
234 LiteralFlavor::FloatNumber { suffix: suffix } 234 LiteralKind::FloatNumber { suffix: suffix }
235 } 235 }
236 STRING | RAW_STRING => LiteralFlavor::String, 236 STRING | RAW_STRING => LiteralKind::String,
237 TRUE_KW | FALSE_KW => LiteralFlavor::Bool, 237 TRUE_KW | FALSE_KW => LiteralKind::Bool,
238 BYTE_STRING | RAW_BYTE_STRING => LiteralFlavor::ByteString, 238 BYTE_STRING | RAW_BYTE_STRING => LiteralKind::ByteString,
239 CHAR => LiteralFlavor::Char, 239 CHAR => LiteralKind::Char,
240 BYTE => LiteralFlavor::Byte, 240 BYTE => LiteralKind::Byte,
241 _ => unreachable!(), 241 _ => unreachable!(),
242 } 242 }
243 } 243 }