feat: lifetime elision, tooling CI, registry, and LSP locals
Ship the QUALITY_PLAN stretch from ownership through ecosystem: C.1 lifetime elision (bootstrap + selfhost), bux fmt/test/doc CI hooks, stdlib goldens, package registry (bux search/add), and LSP 0.4 position-sensitive locals with inferred let types. Full-tree format pass plus Map/Set remove double-free fix.
This commit is contained in:
+28
-28
@@ -1,39 +1,39 @@
|
||||
module Std::Slice {
|
||||
|
||||
extern func bux_bounds_check(index: uint, len: uint);
|
||||
extern func bux_bounds_check(index: uint, len: uint);
|
||||
|
||||
struct Slice<T> {
|
||||
data: *T,
|
||||
len: uint,
|
||||
}
|
||||
struct Slice<T> {
|
||||
data: *T,
|
||||
len: uint,
|
||||
}
|
||||
|
||||
func Slice_FromArray<T>(arr: *Array<T>) -> Slice<T> {
|
||||
var s: Slice<T>;
|
||||
s.data = arr.data;
|
||||
s.len = arr.len;
|
||||
return s;
|
||||
}
|
||||
func Slice_FromArray<T>(arr: *Array<T>) -> Slice<T> {
|
||||
var s: Slice<T>;
|
||||
s.data = arr.data;
|
||||
s.len = arr.len;
|
||||
return s;
|
||||
}
|
||||
|
||||
func Slice_Get<T>(self: *Slice<T>, idx: uint) -> T {
|
||||
bux_bounds_check(idx, self.len);
|
||||
return self.data[idx];
|
||||
}
|
||||
func Slice_Get<T>(self: *Slice<T>, idx: uint) -> T {
|
||||
bux_bounds_check(idx, self.len);
|
||||
return self.data[idx];
|
||||
}
|
||||
|
||||
func Slice_Set<T>(self: *Slice<T>, idx: uint, value: T) {
|
||||
bux_bounds_check(idx, self.len);
|
||||
self.data[idx] = value;
|
||||
}
|
||||
func Slice_Set<T>(self: *Slice<T>, idx: uint, value: T) {
|
||||
bux_bounds_check(idx, self.len);
|
||||
self.data[idx] = value;
|
||||
}
|
||||
|
||||
func Slice_Len<T>(self: *Slice<T>) -> uint {
|
||||
return self.len;
|
||||
}
|
||||
func Slice_Len<T>(self: *Slice<T>) -> uint {
|
||||
return self.len;
|
||||
}
|
||||
|
||||
func Slice_operator_index_get<T>(self: *Slice<T>, idx: uint) -> T {
|
||||
return Slice_Get<T>(self, idx);
|
||||
}
|
||||
func Slice_operator_index_get<T>(self: *Slice<T>, idx: uint) -> T {
|
||||
return Slice_Get<T>(self, idx);
|
||||
}
|
||||
|
||||
func Slice_operator_index_set<T>(self: *Slice<T>, idx: uint, value: T) {
|
||||
Slice_Set<T>(self, idx, value);
|
||||
}
|
||||
func Slice_operator_index_set<T>(self: *Slice<T>, idx: uint, value: T) {
|
||||
Slice_Set<T>(self, idx, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user