-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: began declaration parsing refactors
- Loading branch information
1 parent
d6c49b7
commit 6cba3c6
Showing
7 changed files
with
959 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
strum = { version = "0.26.3", features = ["derive"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
Oops, something went wrong.