Skip to content

Commit

Permalink
feat: Replaced None
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Dec 21, 2023
1 parent f55f4b6 commit 481b409
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions server/src/lang/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ImmutableVisitor<Value, ()> for Program {
panic!("Not implemented");
}
} else {
json!("None")
json!(serde_json::Value::Null)
};

json!({
Expand All @@ -72,12 +72,12 @@ impl ImmutableVisitor<Value, ()> for Program {
})
});
/*
{
pub core: SqlSelectCore,
pub compound: Vec<(SqlCompoundOperator, SqlSelectCore)>,
pub order_by: Option<Vec<(SqlExpr, SqlOrdering)>>,
pub limit: Option<(SqlExpr, Option<SqlExpr>)>,
}
{
pub core: SqlSelectCore,
pub compound: Vec<(SqlCompoundOperator, SqlSelectCore)>,
pub order_by: Option<Vec<(SqlExpr, SqlOrdering)>>,
pub limit: Option<(SqlExpr, Option<SqlExpr>)>,
}
*/
Ok(json!({
"order_by": order_by,
Expand Down Expand Up @@ -264,7 +264,7 @@ impl ImmutableVisitor<Value, ()> for Program {
"else_body": if r#else_body.is_some() {
self.visit_stmt(r#else_body.unwrap())?
} else {
json!("None")
json!(serde_json::Value::Null)
},
})
}
Expand All @@ -279,13 +279,13 @@ impl ImmutableVisitor<Value, ()> for Program {
"condition": if condition.is_some() {
self.visit_expr(condition.unwrap())?
} else {
json!("None")
json!(serde_json::Value::Null)
},
"body": self.visit_stmt(*body)?,
"post": if post.is_some() {
self.visit_stmt(post.unwrap())?
} else {
json!("None")
json!(serde_json::Value::Null)
},
})
}
Expand All @@ -301,7 +301,7 @@ impl ImmutableVisitor<Value, ()> for Program {
"expr": if expr.is_some() {
self.visit_expr(expr.unwrap())?
} else {
json!("None")
json!(serde_json::Value::Null)
},
})
}
Expand Down

0 comments on commit 481b409

Please sign in to comment.