wcc: c-side mangles private decls; main exempt as entry-point convention

This commit is contained in:
2026-05-11 15:29:29 +09:00
parent 895f221b6c
commit e301a198f4
7 changed files with 153 additions and 25 deletions

View File

@@ -196,6 +196,7 @@ struct Lex {
i32 col;
Arena *a; /* token-text arena */
int errs;
const char *module; /* current `// MODULE: foo` directive, or NULL */
};
void lexinit(Lex*, Arena*, const char *file, const char *src, u64 len);
@@ -303,6 +304,11 @@ struct Node {
int export;
Type *type; /* filled in by checker */
const char *tsuffix; /* typed numeric literal suffix */
const char *module; /* `// MODULE: foo` directive at the
* decl's section in combined.ww.
* NULL for nested nodes; only top-
* level decls (fn/def/type/let)
* carry it. */
};
Node *newnode(Arena*, Nkind, Pos);