format the final comments in records

This commit is contained in:
Sébastien Besnier 2020-11-14 18:39:46 +01:00
parent d93e63bbd0
commit 2000948765
4 changed files with 208 additions and 6 deletions

View file

@ -392,6 +392,17 @@ pub enum CommentOrNewline<'a> {
DocComment(&'a str),
}
impl<'a> CommentOrNewline<'a> {
pub fn is_comment(&self) -> bool {
use CommentOrNewline::*;
match self {
Newline => false,
LineComment(_) => true,
DocComment(_) => true,
}
}
}
#[derive(Clone, Debug, PartialEq)]
pub enum Pattern<'a> {
// Identifier