| 1 | // Copyright (c) 2020-2024 Joe Conigliaro. All rights reserved. |
| 2 | // Use of this source code is governed by an MIT license |
| 3 | // that can be found in the LICENSE file. |
| 4 | module ast |
| 5 | |
| 6 | // NOTE: this is just a very naive example of how it could possibly work. |
| 7 | // actual implementation may work during AST -> IR (or not). it may also |
| 8 | // need type information which we don't have here. as I said, just an example. |
| 9 | pub fn (match_expr &MatchExpr) desugar() Expr { |
| 10 | // Keep this helper conservative for now; match lowering happens in transformer. |
| 11 | return match_expr.expr |
| 12 | } |
| 13 | |
| 14 | pub fn (or_expr &OrExpr) desugar() Expr { |
| 15 | // Keep this helper conservative for now; or-lowering happens in transformer. |
| 16 | return or_expr.expr |
| 17 | } |
| 18 | |