Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Jul 28, 2024
1 parent cc21440 commit 5537a12
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions lykiadb-playground/src/regularizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,28 @@ impl<'a> VisitorMut<Tree, ()> for TreeBuilder {
children.push(self.visit_expr(expr)?);
}
"Array".to_string()
},
}
Literal::Object(exprs) => {
for (key, value) in exprs {
// children.push(self.visit_expr(key)?);
children.push(self.visit_expr(value)?);
}
"Object".to_string()
},
}
Literal::Null => "Null".to_string(),
Literal::Undefined => "Undefined".to_string(),
Literal::NaN => "NaN".to_string(),
},
children: Some(children),
span: *span,
}
},
}
Expr::Variable { name, span, id } => {
let mut children = vec![
Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
},
];
let mut children = vec![Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
}];
let token_children = self.get_children(*id);
if let Some(c) = token_children {
children.extend(c);
Expand All @@ -96,7 +94,7 @@ impl<'a> VisitorMut<Tree, ()> for TreeBuilder {
children: Some(children),
span: *span,
}
},
}
Expr::Assignment {
dst,
expr,
Expand Down Expand Up @@ -166,11 +164,10 @@ impl<'a> VisitorMut<Tree, ()> for TreeBuilder {
span,
id,
} => {
let mut children = vec![
Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
let mut children = vec![Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
}];
children.push(self.visit_expr(object)?);
let token_children = self.get_children(*id);
Expand All @@ -190,11 +187,10 @@ impl<'a> VisitorMut<Tree, ()> for TreeBuilder {
span,
id,
} => {
let mut children = vec![
Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
let mut children = vec![Tree {
name: "identifier".to_string(),
children: None,
span: name.span,
}];
children.push(self.visit_expr(object)?);
children.push(self.visit_expr(value)?);
Expand Down

0 comments on commit 5537a12

Please sign in to comment.