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

Function write_repr_lr

prqlc/prqlc/src/debug/render_html.rs:258–273  ·  view source on GitHub ↗
(w: &mut W, tokens: &lr::Tokens)

Source from the content-addressed store, hash-verified

256}
257
258fn write_repr_lr<W: Write>(w: &mut W, tokens: &lr::Tokens) -> Result {
259 writeln!(w, r#"<table class="lr repr">"#)?;
260
261 for token in &tokens.0 {
262 writeln!(w, r#"<tr class="token">"#,)?;
263 writeln!(w, "<td>{}</td>", escape_html(&format!("{:?}", token.kind)))?;
264 writeln!(
265 w,
266 r#"<td><span class="span">{}:{}</span></td>"#,
267 token.span.start, token.span.end
268 )?;
269 writeln!(w, "</tr>")?;
270 }
271
272 writeln!(w, "</table>")
273}
274
275fn write_repr_pr<W: Write>(w: &mut W, ast: &pr::ModuleDef) -> Result {
276 writeln!(w, r#"<div class="pr repr">"#)?;

Callers 1

write_titled_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected