Visibility And Mutability AST

This commit is contained in:
2026-05-05 22:00:39 +02:00
parent 5be6ecb44e
commit ef1585f9fb
2 changed files with 22 additions and 27 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct FieldList(pub Vec<(String, bool, TypeExpr)>);
pub struct FieldList(pub Vec<(String, Visibility, TypeExpr)>);
#[derive(Debug, Clone, Serialize)]
pub struct ParamList(pub Vec<VarDecl>);
@@ -69,13 +69,13 @@ pub enum TopLevelKind {
ModAttribute,
Include(Path),
StructDecl {
export: bool,
export: Visibility,
name: String,
fields: FieldList,
},
FunctionDecl(FunctionDecl),
ClassDecl {
export: bool,
export: Visibility,
name: String,
fields: Vec<VarDeclStmt>,
constructor: ClassConstructor,
@@ -85,14 +85,14 @@ pub enum TopLevelKind {
#[derive(Debug, Clone, Serialize)]
pub struct ClassConstructor {
pub export: bool,
pub export: Visibility,
pub params: ParamList,
pub body: Block,
}
#[derive(Debug, Clone, Serialize)]
pub struct FunctionDecl {
pub export: bool,
pub export: Visibility,
pub name: String,
pub params: ParamList,
pub return_type: TypeExpr,