Add tags to Rust std lib functions (#6701)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-06 14:14:11 +12:00
committed by GitHub
parent 0464de33b1
commit 9c52f5b19a
127 changed files with 892 additions and 447 deletions

View File

@ -140,17 +140,19 @@ impl crate::docs::StdLibFn for MyFunc {
false
}
fn examples(&self) -> Vec<String> {
fn examples(&self) -> Vec<(String, bool)> {
let code_blocks = vec!["This is another code block.\nyes sirrr.\nmyFunc"];
let norun = vec![false];
code_blocks
.iter()
.map(|cb| {
.zip(norun)
.map(|(cb, norun)| {
let program = crate::Program::parse_no_errs(cb).unwrap();
let mut options: crate::parsing::ast::types::FormatOptions = Default::default();
options.insert_final_newline = false;
program.ast.recast(&options, 0)
(program.ast.recast(&options, 0), norun)
})
.collect::<Vec<String>>()
.collect::<Vec<(String, bool)>>()
}
fn std_lib_fn(&self) -> crate::std::StdFn {