Skip to content

Commit

Permalink
✨ Complete analysis with basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Philogy committed Oct 19, 2024
1 parent 43dae0d commit d4eb420
Show file tree
Hide file tree
Showing 4 changed files with 329 additions and 44 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ license.workspace = true

[dependencies]
huff-ast.workspace = true

[dev-dependencies]
chumsky.workspace = true
10 changes: 8 additions & 2 deletions crates/analysis/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use huff_ast::{Definition, Instruction, Invoke, Macro, Spanned};

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AnalysisError<'ast, 'src> {
/// When two different definitions have the same.
DefinitionNameCollision {
Expand All @@ -12,10 +12,12 @@ pub enum AnalysisError<'ast, 'src> {
},
ReferenceNotFound {
scope: &'ast Macro<'src>,
ref_type: &'static str,
not_found: &'ast Instruction<'src>,
},
MacroNotFound {
DefinitionNotFound {
scope: &'ast Macro<'src>,
def_type: &'static str,
name: &'ast Spanned<&'src str>,
},
MacroArgumentCountMismatch {
Expand All @@ -31,4 +33,8 @@ pub enum AnalysisError<'ast, 'src> {
scope: &'ast Macro<'src>,
duplicates: Box<[&'ast Spanned<&'src str>]>,
},
NotYetSupported {
intent: String,
span: Spanned<()>,
},
}
Loading

0 comments on commit d4eb420

Please sign in to comment.