Export parsing
This commit is contained in:
@@ -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<TypeExpr>,
|
||||
|
||||
+6
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user