Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed May 12, 2024
1 parent 99328e8 commit 47f4fb2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions prqlc/prqlc/src/codegen/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub(crate) fn write_expr(expr: &Expr) -> String {
}

fn write_within<T: WriteSource>(node: &T, parent: &ExprKind, mut opt: WriteOpt) -> Option<String> {
// dbg!(&node, &parent);
let parent_strength = binding_strength(parent);
opt.context_strength = opt.context_strength.max(parent_strength);

Expand All @@ -26,7 +25,7 @@ fn write_within<T: WriteSource>(node: &T, parent: &ExprKind, mut opt: WriteOpt)
// these to write comments for. I'm sure there are better ways to do it.
let enable_comments = opt.enable_comments;
opt.enable_comments = false;
let out = dbg!(node.write(opt.clone()));
let out = node.write(opt.clone());
opt.enable_comments = enable_comments;
out
}
Expand Down Expand Up @@ -69,9 +68,6 @@ impl WriteSource for Expr {
}

let comments = find_comments_after(span, &opt.tokens);
// if !comments.is_empty() {
// dbg!(&self, &span, &opt.tokens, &comments);
// }

// If the first item is a comment, it's an inline comment, and
// so add two spaces
Expand All @@ -86,7 +82,7 @@ impl WriteSource for Expr {
}

for c in comments {
match dbg!(c.kind) {
match c.kind {
// TODO: these are defined here since the debug
// representations aren't quite right (NewLine is `new
// line` as is used in error messages). But we should
Expand Down Expand Up @@ -628,7 +624,8 @@ mod test {
"#,
)
.unwrap();
let span = dbg!(tokens.clone())
let span = tokens
.clone()
.0
.iter()
.find(|t| t.kind == TokenKind::Literal(Literal::Integer(5)))
Expand Down

0 comments on commit 47f4fb2

Please sign in to comment.