Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.
  • Loading branch information
max-sixty committed May 12, 2024
commit 47f4fb226081276dc1b9c9e642908c2112f4986c
11 changes: 4 additions & 7 deletions prqlc/prqlc/src/codegen/ast.rs
Original file line number Diff line number Diff line change
@@ -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);

@@ -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
}
@@ -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
@@ -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
@@ -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)))