diff --git a/specs/t27mcp/examples.t27 b/specs/t27mcp/examples.t27 index 5de96306b6..b13d63edd9 100644 --- a/specs/t27mcp/examples.t27 +++ b/specs/t27mcp/examples.t27 @@ -22,6 +22,9 @@ module T27mcpExamples; +// find() and has() are check_hints.t27's; t27c gen inlines them into examples.wasm. +use t27mcp::check_hints::{find, has}; + /// The commit of gHashTag/t27 every row points into. pub const PIN : str = "a18d7ee14a9994ef9dc84dac10e1a2944367d4c5"; @@ -82,31 +85,6 @@ pub const EX_WHY : [10]str = [ "The header states that nothing here is reset: the counters start from their var initialisers." ]; -/// Byte offset of the first occurrence of `needle` in `hay`, or NO_POS. -pub fn find(hay: string, needle: string) -> u32 { - var hn : u32 = (hay.len as u32); - var nn : u32 = (needle.len as u32); - if (nn > hn) { return NO_POS; } - var i : u32 = 0; - while (i <= hn - nn) { - var j : u32 = 0; - var same : u32 = 1; - while (j < nn) { - if ((hay[i + j] as u32) != (needle[j] as u32)) { same = 0; } - j = j + 1; - } - if (same == 1) { return i; } - i = i + 1; - } - return NO_POS; -} - -/// 1 when `needle` occurs in `hay`. -pub fn has(hay: string, needle: string) -> u32 { - if (find(hay, needle) == NO_POS) { return 0; } - return 1; -} - /// The topic a lower-case question is about, or T_NONE. pub fn topic_code(q: string) -> u32 { if (has(q, "reset") == 1) { diff --git a/tools/census/quiet.txt b/tools/census/quiet.txt index 808aed5cdd..c75a742499 100644 --- a/tools/census/quiet.txt +++ b/tools/census/quiet.txt @@ -1,8 +1,8 @@ GATE STEPS WHOSE PASS SURVIVES THE SUBJECT GOING MISSING - workflow files read 66 + workflow files read 67 steps in a quiet shape 32 - named a path but not quiet 198 (--excluded prints them) + named a path but not quiet 200 (--excluded prints them) by shape: failure branch passes 14 `… 2>/dev/null … || echo PASSED` diff --git a/tools/census/shell.txt b/tools/census/shell.txt index 1711e2457d..5fb8b5e402 100644 --- a/tools/census/shell.txt +++ b/tools/census/shell.txt @@ -1,11 +1,11 @@ WHICH INTERPRETER EACH GATE STEP IS HANDED TO, AND WHO SAYS SO - workflow files read 66 - jobs 87 - run: steps 313 + workflow files read 67 + jobs 88 + run: steps 314 who names the shell: - the runner does 292 no container, so bash -eo pipefail + the runner does 293 no container, so bash -eo pipefail a `shell:` key does 6 NOBODY 15 a container and no `shell:` key