Simple semantic analysis structure
This commit is contained in:
+2
-13
@@ -1,14 +1,3 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
pub mod top_level;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
pub struct Scope {}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub struct TypeSymbol {
|
||||
export: bool,
|
||||
name: String,
|
||||
}
|
||||
|
||||
pub struct FunctionSymbol {
|
||||
export: bool,
|
||||
name: String,
|
||||
params: HashMap<String, TypeSymbol>,
|
||||
}
|
||||
|
||||
pub struct StructSymbol {
|
||||
export: bool,
|
||||
name: String,
|
||||
fields: HashMap<String, TypeSymbol>,
|
||||
}
|
||||
Reference in New Issue
Block a user