From 87d74952a614daa7075aeecef462ff51c4dc46e0 Mon Sep 17 00:00:00 2001 From: JJ Date: Tue, 31 Oct 2023 00:47:54 -0700 Subject: compiler: implement most of the parser --- src/ast.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ast.rs') diff --git a/src/ast.rs b/src/ast.rs index e55b473..6c7963e 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -59,6 +59,7 @@ pub enum Binding { value: Option> // variable bindings can be delayed }, Const { + public: bool, id: Pattern, kind: Option, value: Box @@ -83,7 +84,7 @@ pub struct ParamDecl { id: Id, kind: Type } /// Expressions related to control flow. pub enum Control { Call { id: Id, params: Vec }, // function calls, macro invocations, field access... - Cond { + If { branches: Vec, else_body: Option> }, @@ -93,7 +94,7 @@ pub enum Control { finally: Option> }, Match { - item: Box, + item: Pattern, branches: Vec }, Block { id: Option, body: Vec }, -- cgit v1.2.3-70-g09d2