Skip to content

Commit

Permalink
better parsing error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nulluser0 committed Jun 16, 2024
1 parent 85e1483 commit 806d5fe
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 183 deletions.
8 changes: 4 additions & 4 deletions src/frontend/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
str::{Chars, FromStr},
};

#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum Token {
// Keywords
Keyword(Keyword),
Expand Down Expand Up @@ -45,7 +45,7 @@ impl std::fmt::Display for Token {
}

// Keywords
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum Keyword {
Import, // import
Fn, // fn
Expand Down Expand Up @@ -96,7 +96,7 @@ impl FromStr for Keyword {
}

// Operators
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum Operator {
Assign, // =
Add, // +
Expand All @@ -119,7 +119,7 @@ pub enum Operator {
}

// Symbols/Delimiters
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum Symbol {
LeftParen, // (
RightParen, // )
Expand Down
Loading

0 comments on commit 806d5fe

Please sign in to comment.