refactor(ffi-linkage)!: Phase 9.0 — delete the hash_foreign token (src is foreign-free)

Per user directive (total purge): remove the hash_foreign token entirely rather than
keep it for a friendly deprecation message. Deleted: the token enum (token.zig), the
lexer keyword entry + directive-list mention + lex test (lexer.zig), the 4 parser
rejection sites + 2 lookahead clauses + the runtime-class prefix #foreign peek arm
(parser.zig), and the lsp completion arm (server.zig). '#foreign' now lexes as an
invalid '#' token → a generic 'expected ;' parse error (no migration hint — the
accepted UX cost of zero-foreign). Deleted examples/1176-diagnostics-foreign-removed
(its purpose, the friendly rejection, no longer exists).

src/ now contains ZERO 'foreign' (case-insensitive). Suite green (645 corpus / 443
unit, 0 failed). Remaining for the 9.4 gate: issues/*.md prose + example filenames.
This commit is contained in:
agra
2026-06-15 10:59:59 +03:00
parent 811a280517
commit dfae690b31
8 changed files with 10 additions and 67 deletions

View File

@@ -1,10 +0,0 @@
// Phase 8 (FFI-linkage) cutover: the prefix `#foreign` linkage directive has
// been removed. A declaration imports an external C symbol via the postfix
// `extern` keyword (or defines + exposes one via `export`). The parser rejects
// `#foreign` with a clear migration message instead of routing it onto `extern`.
//
// Expected: one error on the `#foreign` token; exit 1.
abs_c :: (n: i32) -> i32 #foreign;
main :: () -> i32 { 0 }

View File

@@ -1,5 +0,0 @@
error: `#foreign` has been removed; use the postfix `extern` (import) / `export` (define) linkage keyword instead
--> examples/1176-diagnostics-foreign-removed.sx:8:26
|
8 | abs_c :: (n: i32) -> i32 #foreign;
| ^^^^^^^^