(w: &mut W, index: usize, entry: &DebugEntry)
| 187 | } |
| 188 | |
| 189 | fn write_titled_entry<W: Write>(w: &mut W, index: usize, entry: &DebugEntry) -> Result { |
| 190 | writeln!(w, r#"<div class=entry>"#)?; |
| 191 | let entry_id = format!("entry-{index}"); |
| 192 | |
| 193 | writeln!( |
| 194 | w, |
| 195 | "<input id={entry_id} class=entry-collapse type=checkbox>" |
| 196 | )?; |
| 197 | |
| 198 | { |
| 199 | writeln!(w, r#"<label for={entry_id} class="entry-label clickable">"#)?; |
| 200 | let kind = entry.kind.as_ref()[4..].to_ascii_uppercase(); |
| 201 | writeln!( |
| 202 | w, |
| 203 | r#"[<b>REPRESENTATION</b>] <span class="yellow">{kind}</span>"#, |
| 204 | )?; |
| 205 | writeln!(w, r#"</label>"#)?; |
| 206 | } |
| 207 | |
| 208 | { |
| 209 | writeln!(w, r#"<div class="entry-content">"#)?; |
| 210 | match &entry.kind { |
| 211 | DebugEntryKind::ReprPrql(a) => write_repr_prql(w, a)?, |
| 212 | DebugEntryKind::ReprLr(a) => write_repr_lr(w, a)?, |
| 213 | DebugEntryKind::ReprPr(a) => write_repr_pr(w, a)?, |
| 214 | DebugEntryKind::ReprPl(a) => write_repr_pl(w, a)?, |
| 215 | DebugEntryKind::ReprDecl(a) => write_repr_decl(w, a)?, |
| 216 | DebugEntryKind::ReprRq(a) => write_repr_rq(w, a)?, |
| 217 | DebugEntryKind::ReprPqEarly(a) => write_repr_pq_early(w, a)?, |
| 218 | DebugEntryKind::ReprPq(a) => write_repr_pq(w, a)?, |
| 219 | DebugEntryKind::ReprSqlParser(a) => write_repr_sql_parser(w, a)?, |
| 220 | DebugEntryKind::ReprSql(a) => write_repr_sql(w, a)?, |
| 221 | DebugEntryKind::NewStage(_) | DebugEntryKind::Message(_) => unreachable!(), |
| 222 | } |
| 223 | writeln!(w, "</div>")?; |
| 224 | } |
| 225 | |
| 226 | writeln!(w, "</div>")?; |
| 227 | Ok(()) |
| 228 | } |
| 229 | |
| 230 | fn write_repr_prql<W: Write>(w: &mut W, source_tree: &SourceTree) -> Result { |
| 231 | writeln!(w, r#"<div class="prql repr">"#)?; |
no test coverage detected