refactor(ffi-linkage): Phase 9.3/9.4 — purge 'foreign' from issues/*.md; GATE PASS
Rewrote 20 issue writeups to the extern/runtime-class vocabulary (#foreign→extern, foreign_class_map→runtime_class_map, parseForeignClassDecl→parseRuntimeClassDecl, findForeignMethodInChain→findRuntimeMethodInChain, dedupeForeignSymbol→ dedupeExternSymbol, is_foreign_c_api→is_extern_c_api, stale filename refs to the renamed examples, foreign-class→runtime-class, bare foreign→extern). Renamed issues/0043-…-foreign-class-…→…-runtime-class-…. PHASE 9 COMPLETE — 9.4 GATE PASSES: zero 'foreign' across src/library/examples/ issues/docs/editors/specs/readme/CLAUDE, excluding only the SQLite API constant SQLITE_CONSTRAINT_FOREIGNKEY + vendored sqlite3.c/.h (upstream third-party). Suite green (644 corpus / 443 unit, 0 failed).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# 0089 — backtick raw-identifier escape + `#import c` foreign-name exemption from the reserved-type-name rule
|
||||
# 0089 — backtick raw-identifier escape + `#import c` extern-name exemption from the reserved-type-name rule
|
||||
|
||||
> **✅ RESOLVED** (foundation step F0.6). Two mechanisms, per Agra's design
|
||||
> ruling; the final shape is the **universal raw identifier** (attempt 4):
|
||||
@@ -13,9 +13,9 @@
|
||||
> declaration node ([src/ast.zig]): `VarDecl` / `ConstDecl` / `Param` / `FnDecl`
|
||||
> plus `IfExpr` / `WhileExpr` optional bindings, `ForExpr` capture + index,
|
||||
> `MatchArm` capture, `CatchExpr` / `OnFailStmt` tag bindings, `DestructureDecl`
|
||||
> per-name, protocol-default / foreign-class method params, AND every
|
||||
> per-name, protocol-default / runtime-class method params, AND every
|
||||
> type-introducing decl — `StructDecl` / `EnumDecl` / `UnionDecl` /
|
||||
> `ErrorSetDecl` / `ProtocolDecl` / `ForeignClassDecl` / `UfcsAlias` /
|
||||
> `ErrorSetDecl` / `ProtocolDecl` / `RuntimeClassDecl` / `UfcsAlias` /
|
||||
> `NamespaceDecl` / `ImportDecl` / `CImportDecl` / `LibraryDecl`.
|
||||
>
|
||||
> - **Value position.** The parser skips `Type.fromName` for a raw identifier
|
||||
@@ -81,15 +81,15 @@
|
||||
> reserved-spelled impl method needs the backtick (`` `i2 :: (self) ``), no
|
||||
> more exempt than a free function (cf. `examples/1122`). Pinned by
|
||||
> `examples/0158-types-reserved-name-member-exempt.sx`.
|
||||
> 2. **`#import c` foreign-name exemption.** `c_import.zig` synthesizes foreign
|
||||
> `#foreign` decls with `Param.is_raw = true` (and the synthesized `FnDecl`
|
||||
> 2. **`#import c` extern-name exemption.** `c_import.zig` synthesizes extern
|
||||
> `extern` decls with `Param.is_raw = true` (and the synthesized `FnDecl`
|
||||
> `is_raw = true`), so generated C names that collide with reserved type names
|
||||
> (`i1`, `i2`) import unedited and a reserved-name foreign fn is bare-callable.
|
||||
> (`i1`, `i2`) import unedited and a reserved-name extern fn is bare-callable.
|
||||
>
|
||||
> **Bare-callable foreign / backtick fn.** `lowerCall` rewrites a `.type_expr`
|
||||
> **Bare-callable extern / backtick fn.** `lowerCall` rewrites a `.type_expr`
|
||||
> callee to an identifier when a function **of RAW provenance** of that name is in
|
||||
> scope ([src/ir/lower.zig]) — scoped to the callee `FnDecl`'s `is_raw` flag, so it
|
||||
> only ever fires for a backtick / `#import c` foreign fn (the decl check guarantees
|
||||
> only ever fires for a backtick / `#import c` extern fn (the decl check guarantees
|
||||
> no bare reserved-name fn exists). `i2(4)` resolves to the function (`TypeName(val)`
|
||||
> is not a cast).
|
||||
>
|
||||
@@ -107,8 +107,8 @@
|
||||
> fields / union tag / protocol method signature — read & written bare and via
|
||||
> backtick; impl method definition takes the backtick),
|
||||
> `examples/1054-errors-backtick-reserved-binding.sx` (`catch`/`onfail` tag
|
||||
> bindings), `examples/1220-ffi-c-import-reserved-name-params.{sx,h,c}` (foreign
|
||||
> param + fn-name exemption, bare-callable foreign fn); negatives
|
||||
> bindings), `examples/1220-ffi-c-import-reserved-name-params.{sx,h,c}` (extern
|
||||
> param + fn-name exemption, bare-callable extern fn); negatives
|
||||
> `examples/1119`/`1121`/`1123` (bare reserved binding across forms),
|
||||
> `examples/1140-diagnostics-reserved-name-const-fn-decl.sx` (bare const + fn decl),
|
||||
> `examples/1141-diagnostics-reserved-name-type-decl.sx` (bare struct / enum / union
|
||||
@@ -156,8 +156,8 @@ declarations — which is what now fires on the C-imported `i1`/`i2`.
|
||||
External / imported source does NOT need to conform to sx naming standards. Two
|
||||
mechanisms:
|
||||
|
||||
1. **Auto-exempt imports.** `#import c` (and other foreign) declarations are
|
||||
treated as RAW identifiers: foreign names are never type-classified and never
|
||||
1. **Auto-exempt imports.** `#import c` (and other extern) declarations are
|
||||
treated as RAW identifiers: extern names are never type-classified and never
|
||||
reserved-checked, so generated bindings "just work" with zero user edits.
|
||||
2. **Backtick raw-identifier for sx code.** A leading backtick makes the following
|
||||
identifier raw — an identifier that is NEVER type-classified, so it bypasses the
|
||||
|
||||
Reference in New Issue
Block a user