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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user