mirror of
https://github.com/exoticorn/curlywas.git
synced 2026-01-20 19:56:42 +01:00
first running uw8 module
This commit is contained in:
10
src/ast.rs
10
src/ast.rs
@@ -5,7 +5,7 @@ pub struct Position(pub usize);
|
||||
pub struct Script<'a> {
|
||||
pub imports: Vec<Import<'a>>,
|
||||
pub global_vars: Vec<GlobalVar<'a>>,
|
||||
pub functions: Vec<Function<'a>>
|
||||
pub functions: Vec<Function<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -19,13 +19,17 @@ pub enum TopLevelItem<'a> {
|
||||
pub struct Import<'a> {
|
||||
pub position: Position,
|
||||
pub import: &'a str,
|
||||
pub type_: ImportType<'a>
|
||||
pub type_: ImportType<'a>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ImportType<'a> {
|
||||
Memory(u32),
|
||||
Variable {name: &'a str, type_: Type},
|
||||
Variable {
|
||||
name: &'a str,
|
||||
type_: Type,
|
||||
mutable: bool,
|
||||
},
|
||||
// Function { name: &'a str, params: Vec<Type>, result: Option<Type> }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user