mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add better package declaration specific error message (#878)
This commit is contained in:
@@ -5204,6 +5204,11 @@ bool parse_file(Parser *p, AstFile *f) {
|
|||||||
|
|
||||||
CommentGroup *docs = f->lead_comment;
|
CommentGroup *docs = f->lead_comment;
|
||||||
|
|
||||||
|
if (f->curr_token.kind != Token_package) {
|
||||||
|
syntax_error(f->curr_token, "Expected a package declaration at the beginning of the file");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
f->package_token = expect_token(f, Token_package);
|
f->package_token = expect_token(f, Token_package);
|
||||||
if (f->package_token.kind != Token_package) {
|
if (f->package_token.kind != Token_package) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user