Use Comment wrapper

This commit is contained in:
Adolfo Ochagavía 2018-10-11 16:25:35 +02:00
parent 27a86cb7df
commit f88e13f539
4 changed files with 78 additions and 36 deletions

View file

@ -227,6 +227,24 @@ impl<'a> AstNode<'a> for CastExpr<'a> {
impl<'a> CastExpr<'a> {}
// Comment
#[derive(Debug, Clone, Copy)]
pub struct Comment<'a> {
syntax: SyntaxNodeRef<'a>,
}
impl<'a> AstNode<'a> for Comment<'a> {
fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
match syntax.kind() {
COMMENT => Some(Comment { syntax }),
_ => None,
}
}
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
}
impl<'a> Comment<'a> {}
// Condition
#[derive(Debug, Clone, Copy)]
pub struct Condition<'a> {