diff --git a/src/parser.cpp b/src/parser.cpp index 833e9ea9f..84fbc5130 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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 tags = array_make(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();