Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quest/m3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ generic std gap is planned here even when moq never calls it.
- [bytes' Chain as a Buf object](/quest/m3/ts-buf-chain.md) - `Chain::copy_to_bytes` across both halves translates, and with it a `Chain` as a `dyn Buf`
- [A Buf object's size](/quest/m3/ts-dyn-buf-size.md) - a `dyn Buf` object holds only the methods some call dispatches to
- [A boxed iterator folds as std's box does](/quest/m3/ts-box-folds.md) - a `Box<I>` reads by `next` where std's `Iterator` for `Box<I>` forwards nothing else
- [mem::take as a function value](/quest/m3/ts-take-value.md) - `mem::take`, `replace`, and `swap` passed as a function value translate
- [Debug of a RefCell or a Cell](/quest/m3/ts-refcell-debug.md) - `{:?}` of a `RefCell`, `Ref`, `RefMut`, and `Cell` translates as std's writes them
- [Placeholders written to a crate's own fmt::Write](/quest/m3/ts-fmt-calls.md) - `write!` with placeholders into a crate's own writer translates, its `write_str` seeing each call std makes
- [Waiting: drop the lang fixture's mul_add allowance](/quest/m3/ts-fma-allowance.md) - the differential fails on any `mul_add` difference again once wasm32's `fma` rounds exactly
Expand Down
14 changes: 0 additions & 14 deletions quest/m3/ts-take-value.md

This file was deleted.

2 changes: 1 addition & 1 deletion ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ crate translation reaches is refused, and so are two versions of one crate it re
| `Duration` | `rt.Duration`: `{ secs, nanos }`, std's whole seconds as an `rt.u64` and the nanoseconds past them, never changed once made |
| `Layout`, `alloc::alloc` | `rt.Layout`: `{ size, align }`, never changed once made, checked as std's constructors check it; `alloc` gives an `rt.Block` of its bytes, which a cast of its pointer to `*mut T` the body shows came from `alloc` or `realloc` makes a JS array of `T`s, values JS copies, as an `rt.AtIndex` of its first; a cast back to `*mut u8` only as what `dealloc` or `realloc` takes, which free the array or copy it into a new one; its bytes, read, written, or cast to any other type, are refused, and fail at run time through a pointer from elsewhere |
| closure | an arrow function, with `[Symbol.dispose]` if it owns a value that drops, and what makes its clone if a clone can't be itself |
| `fn` pointer, function item as a value | the function, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` |
| `fn` pointer, function item as a value | the function, or std's an arrow that calls it as a written call does, as a closure is typed: a `()` result is `undefined`, where a declared function returns `void` |
| `&dyn Trait`, `&mut dyn Trait`, `Box<dyn Trait>`, `Arc<dyn Trait>`, `Rc<dyn Trait>`, `Weak<dyn Trait>`, `Pin<P>` of one | an object with the trait's methods, its supertraits' included: `shape.area$Shape()`; behind an `Arc` or an `Rc`, an `rt.ArcDyn` sharing the count of the `Arc` it was made from |
| `dyn Error` | an object of its `source`, `fmt$Debug`, and `fmt$Display`: `e.source$Error()` |
| `dyn Any` | an instance of the class its value's type was wrapped in, which a downcast checks for: `a instanceof Any.of$dyns_Square ? a.v : undefined` |
Expand Down
16 changes: 8 additions & 8 deletions ts/fixtures/codec/expected/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ export function cases(): Array<(a0: rt.ByteSlice, a1: rt.ByteVec) => undefined>
decodeScript(a0.data, a0.start, a0.length, a1);
}, (a02: rt.ByteSlice, a12: rt.ByteVec): undefined => {
encodeScript(a02.data, a02.start, a02.length, a12);
}, zigzag as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, sizes as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, (a05: rt.ByteSlice, a15: rt.ByteVec): undefined => {
roundtrip$coding_version_Versions(a05.data, a05.start, a05.length, a15);
}, zigzag as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, sizes as (a0: rt.ByteSlice, a1: rt.ByteVec) => undefined, (a03: rt.ByteSlice, a13: rt.ByteVec): undefined => {
roundtrip$coding_version_Versions(a03.data, a03.start, a03.length, a13);
}, (a04: rt.ByteSlice, a14: rt.ByteVec): undefined => {
roundtripLite$lite_group_Group(a04.data, a04.start, a04.length, a14);
}, (a05: rt.ByteSlice, a15: rt.ByteVec): undefined => {
roundtripLite$lite_probe_Probe(a05.data, a05.start, a05.length, a15);
}, (a06: rt.ByteSlice, a16: rt.ByteVec): undefined => {
roundtripLite$lite_group_Group(a06.data, a06.start, a06.length, a16);
encodeMessages(a06.data, a06.start, a06.length, a16);
}, (a07: rt.ByteSlice, a17: rt.ByteVec): undefined => {
roundtripLite$lite_probe_Probe(a07.data, a07.start, a07.length, a17);
}, (a08: rt.ByteSlice, a18: rt.ByteVec): undefined => {
encodeMessages(a08.data, a08.start, a08.length, a18);
}, (a09: rt.ByteSlice, a19: rt.ByteVec): undefined => {
errors(a09.data, a09.start, a09.length, a19);
errors(a07.data, a07.start, a07.length, a17);
}];
}

Expand Down
12 changes: 6 additions & 6 deletions ts/fixtures/lang/args/expected/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export function args(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void {
rt.byteVecPush(out, byRef(data) & 0xff);
rt.byteVecPush(out, rt.iterFold(rt.iterMap(rt.iterSlice(kept(data, kind)), (s: rt.ByteSlice): rt.u8 => {
return opaque(s);
}), 0, (a05: rt.u8, a1: rt.u8): rt.u8 => {
return rt.u8WrappingAdd(a05, a1);
}), 0, (a03: rt.u8, a1: rt.u8): rt.u8 => {
return rt.u8WrappingAdd(a03, a1);
}));
} else if (_4 === 1) {
if (data.length >= 4) {
Expand All @@ -176,17 +176,17 @@ export function args(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void {
return _2[1];
}), opaque)), undefined, true);
if (!(rt.usizeRem(data.length, 2) === 0)) {
f = (a03: rt.ByteSlice): rt.u8 => {
return sum(a03.data, a03.start, a03.length);
f = (a0: rt.ByteSlice): rt.u8 => {
return sum(a0.data, a0.start, a0.length);
};
} else {
f = opaque;
}
rt.byteVecPush(out, f(data));
rt.byteVecPush(out, option_mapOr$0dk8jdr(option_map$1yogfym((data.length !== 0 ? [data.data[data.start], new rt.ByteSlice(data.data, data.start + 1, data.length - 1)] as [rt.u8, rt.ByteSlice] : undefined) as [rt.u8, rt.ByteSlice] | undefined, (_22: [rt.u8, rt.ByteSlice]): rt.ByteSlice => {
return _22[1];
}), 0, (a04: rt.ByteSlice): rt.usize => {
return len(a04.data, a04.start, a04.length);
}), 0, (a02: rt.ByteSlice): rt.usize => {
return len(a02.data, a02.start, a02.length);
}) & 0xff);
} else if (_4 === 3) {
rt.byteVecPush(out, pair(code(out, 1), pick(out, data)));
Expand Down
4 changes: 2 additions & 2 deletions ts/fixtures/lang/borrows/expected/borrows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export function guards(data: rt.ByteSlice, out: rt.ByteVec): void {
rt.byteVecPush(out, _81.value.id);
rt.refRelease(_81);
drop$tuple2_Option_cell_Ref_borrows_Tagged_Option_cell_RefMut_borrows_Tagged([held, heldMut] as [rt.RefCell<Tagged.Tagged> | undefined, rt.RefCell<Tagged.Tagged> | undefined]);
rt.byteVecExtendFromSlice(out, rt.byteVecSlice(rt.refCellClone(bytes, (a02: rt.ByteVec): rt.ByteVec => {
return rt.byteVecFrom(rt.byteVecView(a02));
rt.byteVecExtendFromSlice(out, rt.byteVecSlice(rt.refCellClone(bytes, (a0: rt.ByteVec): rt.ByteVec => {
return rt.byteVecFrom(rt.byteVecView(a0));
}).value));
rt.byteVecPush(out, rt.refCellClone(number, undefined).value & 0xff);
copy[Symbol.dispose]();
Expand Down
4 changes: 2 additions & 2 deletions ts/fixtures/lang/boxes/expected/boxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ export function boxes(kind: rt.u8, data: rt.ByteSlice, out: rt.ByteVec): void {
rt.iterExtendBytes(out, rt.iterSlice(rt.u64ToBeBytes(hash$boxed_Box_slice_u8(b)).reverse()), undefined, true);
rt.byteVecPush(out, a.length & 0xff);
rt.byteVecPush(out, a.length === 0 ? 1 : 0);
rt.byteVecPush(out, rt.iterFold(rt.iterSlice(rt.byteSliceView(a)), 0, (a04: rt.u8, a1: rt.u8): rt.u8 => {
return rt.u8WrappingAdd(a04, a1);
rt.byteVecPush(out, rt.iterFold(rt.iterSlice(rt.byteSliceView(a)), 0, (a0: rt.u8, a1: rt.u8): rt.u8 => {
return rt.u8WrappingAdd(a0, a1);
}));
rt.byteVecPush(out, rt.byteSliceView(a).includes(0) ? 1 : 0);
rt.byteVecPush(out, option_unwrapOr$0r2bmpr(rt.byteSliceFirst(a), 170));
Expand Down
12 changes: 6 additions & 6 deletions ts/fixtures/lang/clones/expected/clones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7454,18 +7454,18 @@ export function owned(data: rt.ByteSlice, plan: Plan.Plan, out: rt.ByteVec): voi
}), undefined, 12, true), drop$Vec_clones_Logged), (value: Logged.Logged[]) => rt.iterSlice(value, rt.drop), true);
rt.drop(rt.iterToOption(it4.next()));
rt.drop(rt.iterToOption(it4.nextBack()));
const clone4: rt.Iter<Logged.Logged> = it4.clone({ i: { v: (a07: Logged.Logged[]): Logged.Logged[] => {
return rt.vecExact(a07.map(Logged.clone$Clone), 8);
const clone4: rt.Iter<Logged.Logged> = it4.clone({ i: { v: (a0: Logged.Logged[]): Logged.Logged[] => {
return rt.vecExact(a0.map(Logged.clone$Clone), 8);
} }, o: { v: Logged.clone$Clone } });
flush(log.value, out);
rt.drop(it4);
flush(log.value, out);
turns$iter_Flatten_vec_IntoIter_Vec_clones_Logged_clones_owned_closure13_clones_owned_closure14(clone4, (it10: rt.Iter<Logged.Logged>): Logged.Logged | undefined => {
return rt.iterToOption(it10.nextBack());
}, plan, (x5: Logged.Logged): rt.u8 => {
const _016: rt.u8 = Logged.id(x5);
const _017: rt.u8 = Logged.id(x5);
x5[Symbol.dispose]();
return _016;
return _017;
}, out);
flush(log.value, out);
const it5: rt.Iter<Logged.Logged> = rt.iterSuccessors(logged(40), (x6: Logged.Logged): Logged.Logged | undefined => {
Expand All @@ -7479,9 +7479,9 @@ export function owned(data: rt.ByteSlice, plan: Plan.Plan, out: rt.ByteVec): voi
turns$iter_Successors_clones_Logged_clones_owned_closure15_clones_owned_closure16_clones_owned_closure17(clone5, (it11: rt.Iter<Logged.Logged>): Logged.Logged | undefined => {
return rt.iterToOption(it11.next());
}, plan, (x7: Logged.Logged): rt.u8 => {
const _020: rt.u8 = Logged.id(x7);
const _021: rt.u8 = Logged.id(x7);
x7[Symbol.dispose]();
return _020;
return _021;
}, out);
rt.drop(it5);
flush(log.value, out);
Expand Down
Loading