v / vlib / v2 / ast / desugar.v
17 lines · 15 sloc · 702 bytes · 0fb301386f4f9a1ba175469390a138709b8ffe81
Raw
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.
4module 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.
9pub 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
14pub 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