diff options
| author | Mica White <botahamec@outlook.com> | 2026-09-27 15:48:03 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-09-27 15:48:03 -0400 |
| commit | 35f6fc17d0c98f424e01904b8856cf42c80bcfd3 (patch) | |
| tree | ba99ada4ac6e149c00e5d820b9c5f65e82fed980 /src/analyze.rs | |
| parent | 8399983fd45bc0f11eac9def280c0833ffb93c04 (diff) | |
Add buggy diagnostics
Diffstat (limited to 'src/analyze.rs')
| -rw-r--r-- | src/analyze.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/analyze.rs b/src/analyze.rs index 7debb0d..b8a7012 100644 --- a/src/analyze.rs +++ b/src/analyze.rs @@ -1,7 +1,4 @@ -use std::{ - collections::HashMap, - sync::atomic::{AtomicUsize, Ordering::Relaxed}, -}; +use std::{collections::HashMap, sync::atomic::AtomicUsize}; use bumpalo::Bump; @@ -12,10 +9,12 @@ use crate::{ static NEXT_ID: AtomicUsize = AtomicUsize::new(0); +#[derive(Debug, Default)] pub struct SymbolTableSet<'a> { symbol_tables: HashMap<SymbolTableId, ScopedSymbolTable<'a>>, } +#[derive(Debug, Default)] pub struct ScopedSymbolTable<'a> { pub modules: HashMap<ModuleSymbolId, ModuleSymbol<'a>>, pub constants: HashMap<ConstantSymbolId, ConstantSymbol<'a>>, @@ -32,6 +31,7 @@ pub struct ConstantSymbolId(pub usize); #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct HeadSymbolId(pub usize); +#[derive(Debug)] pub struct ModuleSymbol<'a> { pub id: ModuleSymbolId, pub name: Option<&'a str>, @@ -39,6 +39,7 @@ pub struct ModuleSymbol<'a> { pub definition_site: Option<Element<'a>>, } +#[derive(Debug)] pub struct ConstantSymbol<'a> { pub id: ConstantSymbolId, pub name: Option<&'a str>, @@ -47,12 +48,14 @@ pub struct ConstantSymbol<'a> { pub definition_site: Option<Element<'a>>, } +#[derive(Debug)] pub struct HeadSymbol<'a> { pub id: HeadSymbolId, pub contents: Option<ConstantSymbolId>, pub definition_site: Option<Element<'a>>, } +#[derive(Debug)] pub enum ConstantType<'a> { String, Block { @@ -61,10 +64,12 @@ pub enum ConstantType<'a> { }, } +#[derive(Debug)] pub enum ConstantValue<'a> { String(&'a str), } +#[derive(Debug)] pub enum ConstantExpression<'a> { Name(&'a str), Value(ConstantValue<'a>), @@ -77,7 +82,7 @@ pub enum ConstantExpression<'a> { } fn next_id() -> usize { - NEXT_ID.fetch_add(1, Relaxed) + NEXT_ID.fetch_add(1, std::sync::atomic::Ordering::Relaxed) } fn element_attributes<'a>( @@ -273,7 +278,7 @@ fn add_block<'a>( ConstantSymbol { id, name, - // fill this in + // TODO fill this in ty: None, value: Some(fragment), definition_site: Some(*element), |
