store the final comments in the AST for record & tag union annotations

This commit is contained in:
Sébastien Besnier 2020-11-18 15:41:17 +01:00
parent c692319fb9
commit 52bace2c25
3 changed files with 29 additions and 10 deletions

View file

@ -322,6 +322,7 @@ pub enum TypeAnnotation<'a> {
/// The row type variable in an open record, e.g. the `r` in `{ name: Str }r`.
/// This is None if it's a closed record annotation like `{ name: Str }`.
ext: Option<&'a Loc<TypeAnnotation<'a>>>,
final_comments: &'a [CommentOrNewline<'a>],
},
/// A tag union, e.g. `[
@ -330,6 +331,7 @@ pub enum TypeAnnotation<'a> {
/// The row type variable in an open tag union, e.g. the `a` in `[ Foo, Bar ]a`.
/// This is None if it's a closed tag union like `[ Foo, Bar]`.
ext: Option<&'a Loc<TypeAnnotation<'a>>>,
final_comments: &'a [CommentOrNewline<'a>],
},
/// The `*` type variable, e.g. in (List *)