diff options
author | JJ | 2023-10-31 07:47:54 +0000 |
---|---|---|
committer | JJ | 2023-10-31 07:47:54 +0000 |
commit | 87d74952a614daa7075aeecef462ff51c4dc46e0 (patch) | |
tree | 3ab7269e32dbbbfc2adbf7061e886159cb90f968 /src/ast.rs | |
parent | f3efbfc03fabae11df0554e67769327d4dc57a83 (diff) |
compiler: implement most of the parser
Diffstat (limited to 'src/ast.rs')
-rw-r--r-- | src/ast.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -59,6 +59,7 @@ pub enum Binding { value: Option<Box<Expr>> // variable bindings can be delayed }, Const { + public: bool, id: Pattern, kind: Option<Type>, value: Box<Expr> @@ -83,7 +84,7 @@ pub struct ParamDecl { id: Id, kind: Type } /// Expressions related to control flow. pub enum Control { Call { id: Id, params: Vec<Expr> }, // function calls, macro invocations, field access... - Cond { + If { branches: Vec<CondBranch>, else_body: Option<Vec<Expr>> }, @@ -93,7 +94,7 @@ pub enum Control { finally: Option<Vec<Expr>> }, Match { - item: Box<Expr>, + item: Pattern, branches: Vec<MatchBranch> }, Block { id: Option<Id>, body: Vec<Expr> }, |