Skip to main content

mysz_core/semantics/
analysis.rs

1use std::collections::HashMap;
2
3use crate::{parse::parsing::Type, utils::location::Location};
4
5#[derive(Debug)]
6pub struct Symbol {
7    pub name: String,
8    pub ty: Type,
9}
10
11#[derive(Debug)]
12pub struct Scope {
13    pub symbols: HashMap<String, Symbol>,
14    pub parent: Option<usize>,
15}
16
17#[derive(Clone, Debug)]
18pub struct StructSignature {
19    pub generic_params: Vec<String>,
20    pub fields: HashMap<String, Type>,
21    pub location: Location,
22}
23
24#[derive(Clone, Debug)]
25pub struct FunctionSignature {
26    pub generic_params: Vec<String>,
27    pub param_types: Vec<Type>,
28    pub return_type: Type,
29    pub location: Location,
30}