aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/syntax_kind.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-08-12 16:06:49 +0100
committerAleksey Kladov <[email protected]>2020-08-12 16:14:23 +0100
commit50a02eb3593591a02677e1b56f24d7ff0459b9d0 (patch)
treea17351b1e3addea0a719f38990fea9289b6ef65e /crates/ra_parser/src/syntax_kind.rs
parent6dafc13f5f776980cd2560fb79d3d4790811c96d (diff)
Rename ra_parser -> parser
Diffstat (limited to 'crates/ra_parser/src/syntax_kind.rs')
-rw-r--r--crates/ra_parser/src/syntax_kind.rs25
1 files changed, 0 insertions, 25 deletions
diff --git a/crates/ra_parser/src/syntax_kind.rs b/crates/ra_parser/src/syntax_kind.rs
deleted file mode 100644
index 63204436c..000000000
--- a/crates/ra_parser/src/syntax_kind.rs
+++ /dev/null
@@ -1,25 +0,0 @@
1//! FIXME: write short doc here
2
3#[macro_use]
4mod generated;
5
6pub use self::generated::SyntaxKind;
7
8impl From<u16> for SyntaxKind {
9 fn from(d: u16) -> SyntaxKind {
10 assert!(d <= (SyntaxKind::__LAST as u16));
11 unsafe { std::mem::transmute::<u16, SyntaxKind>(d) }
12 }
13}
14
15impl From<SyntaxKind> for u16 {
16 fn from(k: SyntaxKind) -> u16 {
17 k as u16
18 }
19}
20
21impl SyntaxKind {
22 pub fn is_trivia(self) -> bool {
23 matches!(self, SyntaxKind::WHITESPACE | SyntaxKind::COMMENT)
24 }
25}