mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Regression with .gitkeep in project init. List.init incorrectly didn't have the first argument the allocator. Added .init to priority queue. Created mem thread allocator alias. Correctly handle ident aliases. Allow ident on builtin aliases.
This commit is contained in:
@@ -406,6 +406,7 @@ bool decl_needs_prefix(Decl *decl)
|
||||
switch (decl->decl_kind)
|
||||
{
|
||||
case DECL_VAR:
|
||||
case DECL_DEFINE:
|
||||
case DECL_FUNC:
|
||||
case DECL_MACRO:
|
||||
return !decl->is_autoimport;
|
||||
|
||||
@@ -2109,10 +2109,12 @@ static inline Decl *parse_def_attribute(ParseContext *c)
|
||||
CONSUME_OR_RET(TOKEN_LBRACE, poisoned_decl);
|
||||
|
||||
bool is_cond;
|
||||
if (!parse_attributes(c, &attributes, NULL, NULL, &is_cond)) return poisoned_decl;
|
||||
bool is_builtin;
|
||||
if (!parse_attributes(c, &attributes, NULL, decl_needs_prefix(decl) ? &is_builtin : NULL, &is_cond)) return poisoned_decl;
|
||||
CONSUME_OR_RET(TOKEN_RBRACE, poisoned_decl);
|
||||
decl->attr_decl.attrs = attributes;
|
||||
decl->is_cond = is_cond;
|
||||
decl->is_autoimport = is_builtin;
|
||||
if (!parse_attributes_for_global(c, decl)) return poisoned_decl;
|
||||
CONSUME_EOS_OR_RET(poisoned_decl);
|
||||
return decl;
|
||||
|
||||
@@ -1093,6 +1093,9 @@ static inline bool sema_expr_analyse_identifier(SemaContext *context, Type *to,
|
||||
case DECL_MACRO:
|
||||
message = "Macros from other modules must be prefixed with the module name.";
|
||||
break;
|
||||
case DECL_DEFINE:
|
||||
message = "Aliases from other modules must be prefixed with the module name.";
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE
|
||||
}
|
||||
|
||||
@@ -509,7 +509,7 @@ const char *file_append_path_temp(const char *path, const char *name)
|
||||
#endif
|
||||
|
||||
// format the string safely
|
||||
bool insert_separator = path[path_len - 1] == '/' || path[path_len - 1] == separator;
|
||||
bool insert_separator = path[path_len - 1] != '/' && path[path_len - 1] != separator;
|
||||
int written = insert_separator
|
||||
? snprintf(path_buffer, PATH_BUFFER_SIZE, "%s%c%s", path, separator, name)
|
||||
: snprintf(path_buffer, PATH_BUFFER_SIZE, "%s%s", path, name);
|
||||
|
||||
Reference in New Issue
Block a user