functional changes

This commit is contained in:
Aidan 2024-07-27 11:40:37 -04:00
parent d5db3137a3
commit 3c78b4fb86
6 changed files with 52 additions and 15 deletions

View file

@ -795,7 +795,7 @@ pub enum ValueDef<'a> {
AnnotatedBody {
ann_pattern: &'a Loc<Pattern<'a>>,
ann_type: &'a Loc<TypeAnnotation<'a>>,
comment: Option<&'a str>,
comment: &'a [CommentOrNewline<'a>],
body_pattern: &'a Loc<Pattern<'a>>,
body_expr: &'a Loc<Expr<'a>>,
},

View file

@ -1275,9 +1275,7 @@ macro_rules! join_ann_to_body {
let value_def = ValueDef::AnnotatedBody {
ann_pattern: $arena.alloc(*$ann_pattern),
ann_type: $arena.alloc(*$ann_type),
comment: $spaces_before_current
.first()
.and_then($crate::ast::CommentOrNewline::comment_str),
comment: $spaces_before_current,
body_pattern: $arena.alloc($loc_pattern),
body_expr: *$arena.alloc($loc_def_expr),
};
@ -1311,9 +1309,7 @@ macro_rules! join_alias_to_body {
let value_def = ValueDef::AnnotatedBody {
ann_pattern: $arena.alloc(loc_ann_pattern),
ann_type: $arena.alloc(*$ann_type),
comment: $spaces_before_current
.first()
.and_then($crate::ast::CommentOrNewline::comment_str),
comment: $spaces_before_current,
body_pattern: $arena.alloc($loc_pattern),
body_expr: *$arena.alloc($loc_def_expr),
};