MCPcopy Create free account
hub / github.com/PRQL/prql / write_titled_entry

Function write_titled_entry

prqlc/prqlc/src/debug/render_html.rs:189–228  ·  view source on GitHub ↗
(w: &mut W, index: usize, entry: &DebugEntry)

Source from the content-addressed store, hash-verified

187}
188
189fn 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
230fn write_repr_prql<W: Write>(w: &mut W, source_tree: &SourceTree) -> Result {
231 writeln!(w, r#"<div class="prql repr">"#)?;

Callers 2

write_debug_logFunction · 0.85
write_stage_contentsFunction · 0.85

Calls 10

write_repr_prqlFunction · 0.85
write_repr_lrFunction · 0.85
write_repr_prFunction · 0.85
write_repr_plFunction · 0.85
write_repr_declFunction · 0.85
write_repr_rqFunction · 0.85
write_repr_pq_earlyFunction · 0.85
write_repr_pqFunction · 0.85
write_repr_sql_parserFunction · 0.85
write_repr_sqlFunction · 0.85

Tested by

no test coverage detected