rust/src/syntax_kinds/mod.rs
Aleksey Kladov 415c891d64 Reorganize
2018-07-29 15:16:07 +03:00

28 lines
512 B
Rust

mod generated;
use std::fmt;
use ::{SyntaxKind::*};
pub use self::generated::SyntaxKind;
impl fmt::Debug for SyntaxKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = self.info().name;
f.write_str(name)
}
}
pub(crate) struct SyntaxInfo {
pub name: &'static str,
}
impl SyntaxKind {
pub(crate) fn is_trivia(self: SyntaxKind) -> bool {
match self {
WHITESPACE | COMMENT | DOC_COMMENT => true,
_ => false,
}
}
}