From 2aef4c20be23b94525e075e9a41f6dbfae3aac47 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Tue, 14 Apr 2026 02:59:45 +0200 Subject: [PATCH] Export parsing --- src/parser/ast.rs | 2 ++ src/parser/mod.rs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser/ast.rs b/src/parser/ast.rs index 55dc6bf..28939c3 100644 --- a/src/parser/ast.rs +++ b/src/parser/ast.rs @@ -11,10 +11,12 @@ pub enum TypeExpr { pub enum TopLevel { Import(String), StructDecl { + export: bool, name: String, fields: ParamList, }, FunctionDecl { + export: bool, name: String, params: ParamList, return_type: Option, diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 935f198..ead59f9 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -92,6 +92,7 @@ impl TopLevel { // For now, we'll just ignore the function body and return an empty vector Some(TopLevel::FunctionDecl { + export, name, params, return_type, @@ -115,7 +116,11 @@ impl TopLevel { let fields_pair = inner.next().unwrap(); let fields = ParamList::from_pair(fields_pair); - Some(TopLevel::StructDecl { name, fields }) + Some(TopLevel::StructDecl { + export, + name, + fields, + }) } Rule::EOI => None,