Skip to content

Commit

Permalink
feat: began declaration parsing refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleacolburn committed Sep 15, 2024
1 parent d6c49b7 commit 6cba3c6
Show file tree
Hide file tree
Showing 7 changed files with 959 additions and 34 deletions.
72 changes: 72 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
strum = { version = "0.26.3", features = ["derive"] }
2 changes: 2 additions & 0 deletions src/analyzer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use crate::parser::{TokenNode as Node};
use crate::error::{ErrType as ET}
27 changes: 27 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// Each variant wraps the line numberi the error was found on
#[derive(Debug, Clone, strum::Display)]
pub enum ErrType {
ExpectedCParen,
ExpectedCSquare,
ExpectedExpression,
ExpectedId,
UndeclaredId,
ExpectedAssignment,
ExpectedStatement,
ExpectedCondition,
ExpectedOSquare,
ExpectedOParen,
ExpectedCCurl,
ExpectedOCurl,
ExpectedStrLiteral,
ExpectedType,
ExpectedSemi,
ExpectedEq,
ExpectedNumLiteral,
}

#[derive(Debug, Clone)]
pub struct RhErr {
pub err: ErrType,
pub line: i32,
}
Loading

0 comments on commit 6cba3c6

Please sign in to comment.