mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-14 18:45:50 +00:00
Make sure to assign proper comment as package docs
So far, the first comment found was marked as package docs, which
meant that for the following code, the TODO comment would be assigned
to the package declaration instead of the comment directly preceding
the package declaration.
// TODO: drop after finished with refactoring
#+ feature using-stmt
// Package foo implements this and that.
package foo
This commit is contained in:
@@ -6725,11 +6725,6 @@ gb_internal bool parse_file(Parser *p, AstFile *f) {
|
||||
|
||||
String filepath = f->tokenizer.fullpath;
|
||||
String base_dir = dir_from_path(filepath);
|
||||
if (f->curr_token.kind == Token_Comment) {
|
||||
consume_comment_groups(f, f->prev_token);
|
||||
}
|
||||
|
||||
CommentGroup *docs = f->lead_comment;
|
||||
|
||||
Array<Token> tags = array_make<Token>(temporary_allocator());
|
||||
bool first_invalid_token_set = false;
|
||||
@@ -6751,6 +6746,8 @@ gb_internal bool parse_file(Parser *p, AstFile *f) {
|
||||
}
|
||||
}
|
||||
|
||||
CommentGroup *docs = f->lead_comment;
|
||||
|
||||
if (f->curr_token.kind != Token_package) {
|
||||
ERROR_BLOCK();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user