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 @@ -30,7 +30,6 @@ generic std gap is planned here even when moq never calls it.
- [Drop order in std's folds and iterators](/quest/m3/ts-drop-order.md) - the values that drop still refused in std's consumers and collects drop as std's do
- [A slice of one value behind any &mut](/quest/m3/ts-slice-of-one.md) - `slice::from_mut` and `array::from_mut` of a `&mut u8`, or of an object no place names, translate
- [std's calls of a closure that have no mapping](/quest/m3/ts-closure-calls.md) - `try_fold`, `partition`, `repeat_with`, `sort_by_cached_key`, and `LazyCell::new` translate, dropping what their closures own as std's do
- [A closure that drops given to a string's edit or search](/quest/m3/ts-string-closures.md) - `String::retain` and `str`'s searches by a closure that owns a value that drops translate
- [Waiting: a slice object for a mutable part of other values](/quest/m3/ts-slice-object.md) - waits on a moq profile showing the `Proxy` view's traps matter, then decides on an `rt.ByteSlice`-like form
- [Port the workflow guard to kixelated/quest](/quest/m3/quest-workflow-guard.md) - quest's environment guard parses YAML as this repository's does
- [Folds from the back, and a crate's own folds](/quest/m3/ts-iter-back-folds.md) - `rfold` and `try_rfold` translate, and so does a crate's iterator that overrides `fold` or `nth_back`
Expand Down
18 changes: 0 additions & 18 deletions quest/m3/ts-string-closures.md

This file was deleted.

6 changes: 4 additions & 2 deletions ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,14 @@ iterator as it is made and again each time a clone ends.

A `str` is a JS string, which is UTF-16: `chars` steps by code point, and a search by a
`char`, a `&str`, a predicate, or an array or slice of chars, as in `rt.strSplit(s, "/")`, takes the text or the
closure, which it calls on each char it reads, in the order std reads them. An offset it
closure, which it calls on each char it reads, in the order std reads them, and drops as it
returns, or with the iterator it returns, as `split` does. An offset it
returns, from `rfind` or `match_indices`, counts UTF-8 bytes, as Rust's does, and so does
one `&s[a..b]` or `&s[a..=b]` takes, which reads the string up to it and panics as std
does inside a char, where `get` gives `None`. A JS string can't change in place, so `String`'s edits, `push_str`, `truncate`,
`insert`, `retain`, `replace_range`, and the rest, assign the edited one to the local or
field the `&mut` borrows, taking and checking byte offsets as std does. A `&mut str` is
field the `&mut` borrows, taking and checking byte offsets as std does, and `retain` then
drops its closure. A `&mut str` is
the `rt.Place` of its `String` wherever that is, and a part of one, from `&mut s[a..b]`,
`get_mut`, or `split_at_mut`, is `rt.strPart(p, a, b)`, a place of its own that writes the
whole string anew, checking its offsets as `&s[a..b]` does. `as_bytes_mut`,
Expand Down
1,158 changes: 573 additions & 585 deletions ts/fixtures/reject/census.md

Large diffs are not rendered by default.

438 changes: 218 additions & 220 deletions ts/fixtures/reject/expected.txt

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions ts/fixtures/reject/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ pub fn batched(v: Vec<Batched>) -> usize {
set.len()
}

/// A closure that owns a value that drops, given as a `Pattern`, which `contains` would
/// call but never drop.
pub fn pattern_closure(s: &str) -> bool {
let n = Noisy(1);
s.contains(move |c: char| c as u8 == (&n).0)
}

/// A `Cow<str>` is a JS string, which keeps no variant to match on or ask about.
pub fn cow_matched(c: std::borrow::Cow<'_, str>) -> String {
match c {
Expand Down Expand Up @@ -713,12 +706,6 @@ pub fn pointer_statics(p: *mut u32) -> u32 {
*NAMED
}

/// A closure that owns a value that drops, which `String::retain` would call but never drop.
pub fn string_retained(s: &mut String) {
let n = Noisy(1);
s.retain(move |c| c as u8 != (&n).0);
}

/// A census lowers this over `F` and `O`, and `awaited`'s body with it, whose closure names
/// `O` as this function's second type parameter: that refuses nothing.
pub async fn generic_awaited<F: Fn() -> u8, O: std::future::Future<Output = u8>>(f: F, o: O) -> u8 {
Expand Down
2 changes: 0 additions & 2 deletions ts/fixtures/reject/ts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ roots = [
"cow_made",
"lopsided",
"batched",
"pattern_closure",
"parts_summed",
"ok_passed",
"places_equal",
Expand Down Expand Up @@ -110,7 +109,6 @@ roots = [
"places_sorted",
"pointer_statics",
"bound_ranges",
"string_retained",
"put_replaced",
"object_replaced",
"closure_replaced",
Expand Down
6 changes: 6 additions & 0 deletions ts/fixtures/task/expected/drops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { run as lists_run } from "./drops/lists.ts";
import { boxed as objects_boxed, shared, anys, fns } from "./drops/objects.ts";
import { run as once_run } from "./drops/once.ts";
import { released as released_released } from "./drops/released.ts";
import { searched as searched_searched } from "./drops/searched.ts";
import * as Held from "./drops.Held.ts";
import * as Key from "./drops.Key.ts";
import * as Named from "./drops.Named.ts";
Expand Down Expand Up @@ -1311,6 +1312,11 @@ export function released(log: Log.Log, id: rt.u32, arg: rt.u8): void {
released_released(log, id, arg);
}

/** Run scenario `arg % 3` of where std drops a closure given to a string's search or edit. */
export function searched(log: Log.Log, id: rt.u32, arg: rt.u8): void {
searched_searched(log, id, arg);
}

/** Run scenario `arg % 9` of what std's comparisons of iterators drop. */
export function compared(log: Log.Log, id: rt.u32, arg: rt.u8): void {
iters_compared(log, id, arg);
Expand Down
Loading