feat(selfhost): add &T (shared ref) and &mut T (mutable ref) type syntax

- Add tekRef and tekMutRef to TypeExpr enum (ast.bux)
- Parse &T and &mut T in parserParseType, before *T handling (parser.bux)
- Map tekRef/tekMutRef to tyPointer in HIR lowering (hir_lower.bux)
- Both emit as T* in C backend (same as raw pointer)
- Borrow checker rejects write-through-pointer in @[Checked] functions
  for all pointer types (safe default)
This commit is contained in:
2026-06-09 17:30:19 +03:00
parent 81281cbb11
commit f809827bea
3 changed files with 30 additions and 1 deletions
+2
View File
@@ -26,6 +26,8 @@ const tekNamed: int = 0;
const tekPath: int = 1;
const tekSlice: int = 2;
const tekPointer: int = 3;
const tekRef: int = 7; // &T — shared reference
const tekMutRef: int = 8; // &mut T — mutable reference
const tekTuple: int = 4;
const tekSelf: int = 5;
const tekFunc: int = 6;