Skip to content

Commit

Permalink
del(language): Removed default keyword
Browse files Browse the repository at this point in the history
Tracking issue: #119
  • Loading branch information
ElBe-Plaq committed Mar 21, 2024
1 parent a3faba8 commit 11b4704
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 1 addition & 9 deletions crates/lexer/src/tokens/keyword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ pub enum Keyword {
Const,
/// The `continue` keyword. Used to continue a loop before all of it's code is executed.
Continue,
/// The `default` keyword. Used in combination with the [`match`](`Keyword::Match`) and [`case`](`Keyword::Case`) keywords to match the default case.
Default,
/// The `else` keyword. Used to define the "otherwise" block of an [`if`](`Keyword::If`) statement.
Else,
/// The `finally` keyword. Used in combination with the [`try`](`Keyword::Try`) keyword to execute code even after an exception has been raised.
Expand All @@ -66,7 +64,7 @@ pub enum Keyword {
If,
/// The `import` keyword. Used to import code from other modules.
Import,
/// The `match` keyword. Used in combination with the [`case`](`Keyword::Case`) and [`default`](`Keyword::Default`) keywords.
/// The `match` keyword. Used in combination with the [`case`](`Keyword::Case`) keyword.
Match,
/// The `pub` keyword. Used to export an item out of the current scope.
Pub,
Expand Down Expand Up @@ -96,7 +94,6 @@ impl core::fmt::Display for Keyword {
&Self::Class => write!(formatter, "class"),
&Self::Const => write!(formatter, "const"),
&Self::Continue => write!(formatter, "continue"),
&Self::Default => write!(formatter, "default"),
&Self::Else => write!(formatter, "else"),
&Self::Finally => write!(formatter, "finally"),
&Self::For => write!(formatter, "for"),
Expand Down Expand Up @@ -157,11 +154,6 @@ impl GetToken for Keyword {
content: "continue".to_owned(),
token_type: TokenType::Keyword(Keyword::Continue),
}),
"default" => Some(Token {
location,
content: "default".to_owned(),
token_type: TokenType::Keyword(Keyword::Default),
}),
"else" => Some(Token {
location,
content: "else".to_owned(),
Expand Down
2 changes: 0 additions & 2 deletions crates/lexer/tests/tokens/keyword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ mod tests {
assert_eq!(&format!("{}", Keyword::Class), "class");
assert_eq!(&format!("{}", Keyword::Const), "const");
assert_eq!(&format!("{}", Keyword::Continue), "continue");
assert_eq!(&format!("{}", Keyword::Default), "default");
assert_eq!(&format!("{}", Keyword::Else), "else");
assert_eq!(&format!("{}", Keyword::Finally), "finally");
assert_eq!(&format!("{}", Keyword::For), "for");
Expand Down Expand Up @@ -81,7 +80,6 @@ mod tests {
assert!(generate_test(&location, "class", Keyword::Class));
assert!(generate_test(&location, "const", Keyword::Const));
assert!(generate_test(&location, "continue", Keyword::Continue));
assert!(generate_test(&location, "default", Keyword::Default));
assert!(generate_test(&location, "else", Keyword::Else));
assert!(generate_test(&location, "finally", Keyword::Finally));
assert!(generate_test(&location, "for", Keyword::For));
Expand Down

0 comments on commit 11b4704

Please sign in to comment.