diff options
author | Aleksey Kladov <[email protected]> | 2018-12-08 16:30:35 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-08 16:30:35 +0000 |
commit | 4cbc902fcc9de79893779582dac01351d1137c7f (patch) | |
tree | 22b7e547f86270c6f238484fb43dbb523f2e5846 /crates/ra_syntax/src/syntax_kinds.rs | |
parent | 93c0b7d794e55e255b102478e2c482c3037d0acb (diff) |
grand module rename
Diffstat (limited to 'crates/ra_syntax/src/syntax_kinds.rs')
-rw-r--r-- | crates/ra_syntax/src/syntax_kinds.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/syntax_kinds.rs b/crates/ra_syntax/src/syntax_kinds.rs new file mode 100644 index 000000000..d53886676 --- /dev/null +++ b/crates/ra_syntax/src/syntax_kinds.rs | |||
@@ -0,0 +1,26 @@ | |||
1 | mod generated; | ||
2 | |||
3 | use crate::SyntaxKind::*; | ||
4 | use std::fmt; | ||
5 | |||
6 | pub use self::generated::SyntaxKind; | ||
7 | |||
8 | impl fmt::Debug for SyntaxKind { | ||
9 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
10 | let name = self.info().name; | ||
11 | f.write_str(name) | ||
12 | } | ||
13 | } | ||
14 | |||
15 | pub(crate) struct SyntaxInfo { | ||
16 | pub name: &'static str, | ||
17 | } | ||
18 | |||
19 | impl SyntaxKind { | ||
20 | pub fn is_trivia(self) -> bool { | ||
21 | match self { | ||
22 | WHITESPACE | COMMENT => true, | ||
23 | _ => false, | ||
24 | } | ||
25 | } | ||
26 | } | ||