core/odin: Added new file tag syntax as token. parse_file stores a list of tags that the file tag parser can use later.

This commit is contained in:
Karl Zylinski
2024-09-14 17:59:50 +02:00
parent c24e18bf10
commit b12d312408
6 changed files with 81 additions and 16 deletions
+1 -3
View File
@@ -77,9 +77,7 @@ parse_package :: proc(pkg: ^ast.Package, p: ^Parser = nil) -> bool {
if !parse_file(p, file) {
ok = false
}
if file.pkg_decl == nil {
error(p, p.curr_tok.pos, "Expected a package declaration at the start of the file")
} else if pkg.name == "" {
if pkg.name == "" {
pkg.name = file.pkg_decl.name
} else if pkg.name != file.pkg_decl.name {
error(p, file.pkg_decl.pos, "different package name, expected '%s', got '%s'", pkg.name, file.pkg_decl.name)