Writes `func` to `w` as text. write_function_plain is passed as 'closure' to print instructions as text. pretty_function_error is passed as 'closure' to add error decoration.
(
func_w: &mut FW,
w: &mut dyn Write,
func: &Function,
)
| 175 | /// write_function_plain is passed as 'closure' to print instructions as text. |
| 176 | /// pretty_function_error is passed as 'closure' to add error decoration. |
| 177 | pub fn decorate_function<FW: FuncWriter>( |
| 178 | func_w: &mut FW, |
| 179 | w: &mut dyn Write, |
| 180 | func: &Function, |
| 181 | ) -> fmt::Result { |
| 182 | write!(w, "function ")?; |
| 183 | write_function_spec(w, func)?; |
| 184 | writeln!(w, " {{")?; |
| 185 | let aliases = alias_map(func); |
| 186 | let mut any = func_w.write_preamble(w, func)?; |
| 187 | for block in &func.layout { |
| 188 | if any { |
| 189 | writeln!(w)?; |
| 190 | } |
| 191 | decorate_block(func_w, w, func, &aliases, block)?; |
| 192 | any = true; |
| 193 | } |
| 194 | writeln!(w, "}}") |
| 195 | } |
| 196 | |
| 197 | //---------------------------------------------------------------------- |
| 198 | // |
no test coverage detected