mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Update checker.cpp
This commit is contained in:
+11
-3
@@ -3174,7 +3174,7 @@ gb_internal DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) {
|
|||||||
return true;
|
return true;
|
||||||
} else if (name == "link_prefix") {
|
} else if (name == "link_prefix") {
|
||||||
if (ev.kind == ExactValue_String) {
|
if (ev.kind == ExactValue_String) {
|
||||||
String link_prefix = ev.value_string;
|
String link_prefix = string_trim_whitespace(ev.value_string);
|
||||||
if (link_prefix.len != 0 && !is_foreign_name_valid(link_prefix)) {
|
if (link_prefix.len != 0 && !is_foreign_name_valid(link_prefix)) {
|
||||||
error(elem, "Invalid link prefix: '%.*s'", LIT(link_prefix));
|
error(elem, "Invalid link prefix: '%.*s'", LIT(link_prefix));
|
||||||
} else {
|
} else {
|
||||||
@@ -3186,7 +3186,7 @@ gb_internal DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) {
|
|||||||
return true;
|
return true;
|
||||||
} else if (name == "link_suffix") {
|
} else if (name == "link_suffix") {
|
||||||
if (ev.kind == ExactValue_String) {
|
if (ev.kind == ExactValue_String) {
|
||||||
String link_suffix = ev.value_string;
|
String link_suffix = string_trim_whitespace(ev.value_string);
|
||||||
if (link_suffix.len != 0 && !is_foreign_name_valid(link_suffix)) {
|
if (link_suffix.len != 0 && !is_foreign_name_valid(link_suffix)) {
|
||||||
error(elem, "Invalid link suffix: '%.*s'", LIT(link_suffix));
|
error(elem, "Invalid link suffix: '%.*s'", LIT(link_suffix));
|
||||||
} else {
|
} else {
|
||||||
@@ -4474,6 +4474,8 @@ gb_internal void correct_type_aliases_in_scope(CheckerContext *c, Scope *s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_collect_entities_post = false;
|
||||||
|
|
||||||
// NOTE(bill): If file_scopes == nullptr, this will act like a local scope
|
// NOTE(bill): If file_scopes == nullptr, this will act like a local scope
|
||||||
gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &nodes) {
|
gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &nodes) {
|
||||||
AstFile *curr_file = nullptr;
|
AstFile *curr_file = nullptr;
|
||||||
@@ -4532,7 +4534,9 @@ gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &n
|
|||||||
case_end;
|
case_end;
|
||||||
|
|
||||||
case_ast_node(fb, ForeignBlockDecl, decl);
|
case_ast_node(fb, ForeignBlockDecl, decl);
|
||||||
check_add_foreign_block_decl(c, decl);
|
if (is_collect_entities_post) {
|
||||||
|
check_add_foreign_block_decl(c, decl);
|
||||||
|
}
|
||||||
case_end;
|
case_end;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -6437,6 +6441,10 @@ gb_internal void check_parsed_files(Checker *c) {
|
|||||||
TIME_SECTION("export entities - post");
|
TIME_SECTION("export entities - post");
|
||||||
check_export_entities(c);
|
check_export_entities(c);
|
||||||
|
|
||||||
|
TIME_SECTION("collect entities - post");
|
||||||
|
is_collect_entities_post = true;
|
||||||
|
check_collect_entities_all(c);
|
||||||
|
|
||||||
TIME_SECTION("add entities from packages");
|
TIME_SECTION("add entities from packages");
|
||||||
check_merge_queues_into_arrays(c);
|
check_merge_queues_into_arrays(c);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user