chore: Version 0.3 #136

Open
aniva wants to merge 487 commits from dev into main
1 changed files with 6 additions and 8 deletions
Showing only changes of commit 09189ce600 - Show all commits

View File

@ -160,14 +160,12 @@ partial def serialize_expression_ast (expr: Expr) (sanitize: Bool := true): Meta
of_name (name: Name) := name_to_ast name sanitize of_name (name: Name) := name_to_ast name sanitize
def serialize_expression (options: @&Protocol.Options) (e: Expr): MetaM Protocol.Expression := do def serialize_expression (options: @&Protocol.Options) (e: Expr): MetaM Protocol.Expression := do
let pp := toString (← Meta.ppExpr e) let pp?: Option String ← match options.printExprPretty with
let pp?: Option String := match options.printExprPretty with | true => pure $ .some $ toString $ ← Meta.ppExpr e
| true => .some pp | false => pure $ .none
| false => .none let sexp?: Option String ← match options.printExprAST with
let sexp: String ← serialize_expression_ast e | true => pure $ .some $ ← serialize_expression_ast e
let sexp?: Option String := match options.printExprAST with | false => pure $ .none
| true => .some sexp
| false => .none
return { return {
pp?, pp?,
sexp? sexp?