MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / add_block

Method add_block

cranelift/srcgen/src/lib.rs:187–193  ·  view source on GitHub ↗

Add a brace-delimited block that begins with `start`: i.e., ` { }`. This properly indents the contents of the block.

(&mut self, start: &str, f: F)

Source from the content-addressed store, hash-verified

185 /// Add a brace-delimited block that begins with `start`: i.e., `<start> {
186 /// <f()> }`. This properly indents the contents of the block.
187 pub fn add_block<T, F: FnOnce(&mut Formatter) -> T>(&mut self, start: &str, f: F) -> T {
188 assert!(matches!(self.lang, Language::Rust));
189 self.line(format!("{start} {{"));
190 let ret = self.indent(f);
191 self.line("}");
192 ret
193 }
194
195 /// Add a match expression.
196 pub fn add_match(&mut self, m: Match) {

Callers 15

generate_inst_enumFunction · 0.45
match_variantsFunction · 0.45
generate_inst_implsFunction · 0.45
generate_macroMethod · 0.45
generate_structMethod · 0.45
generate_struct_implMethod · 0.45
generate_new_functionMethod · 0.45

Calls 2

lineMethod · 0.45
indentMethod · 0.45

Tested by

no test coverage detected