cue/ast: allow CommentGroup as declaration
This simplifies the construction of ASTs with
Also consecutive comment groups are now always
printed with a newline in between. To not do so,
one will have to merge two consecutive comment
groups manually. This more closely matches the
typical intention of comment groups.
Reviewed-by: Marcel van Lohuizen <firstname.lastname@example.org>
diff --git a/cue/ast.go b/cue/ast.go
index 1db9ad8..1485a2a 100644
@@ -512,6 +512,9 @@
+ case *ast.CommentGroup:
+ // Nothing to do for a free-floating comment group.
// nothing to do
// case *syntax.EmitDecl: