Skip to content

Commit

Permalink
chore!: Reserve enum and match keywords (#6961)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <[email protected]>
  • Loading branch information
jfecher and TomAFrench authored Jan 8, 2025
1 parent 3c488f4 commit e08f4fa
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 75 deletions.
6 changes: 6 additions & 0 deletions compiler/noirc_frontend/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ pub enum Keyword {
CtString,
Dep,
Else,
Enum,
Expr,
Field,
Fn,
Expand All @@ -1033,6 +1034,7 @@ pub enum Keyword {
Impl,
In,
Let,
Match,
Mod,
Module,
Mut,
Expand Down Expand Up @@ -1079,6 +1081,7 @@ impl fmt::Display for Keyword {
Keyword::CtString => write!(f, "CtString"),
Keyword::Dep => write!(f, "dep"),
Keyword::Else => write!(f, "else"),
Keyword::Enum => write!(f, "enum"),
Keyword::Expr => write!(f, "Expr"),
Keyword::Field => write!(f, "Field"),
Keyword::Fn => write!(f, "fn"),
Expand All @@ -1090,6 +1093,7 @@ impl fmt::Display for Keyword {
Keyword::Impl => write!(f, "impl"),
Keyword::In => write!(f, "in"),
Keyword::Let => write!(f, "let"),
Keyword::Match => write!(f, "match"),
Keyword::Mod => write!(f, "mod"),
Keyword::Module => write!(f, "Module"),
Keyword::Mut => write!(f, "mut"),
Expand Down Expand Up @@ -1139,6 +1143,7 @@ impl Keyword {
"CtString" => Keyword::CtString,
"dep" => Keyword::Dep,
"else" => Keyword::Else,
"enum" => Keyword::Enum,
"Expr" => Keyword::Expr,
"Field" => Keyword::Field,
"fn" => Keyword::Fn,
Expand All @@ -1150,6 +1155,7 @@ impl Keyword {
"impl" => Keyword::Impl,
"in" => Keyword::In,
"let" => Keyword::Let,
"match" => Keyword::Match,
"mod" => Keyword::Mod,
"Module" => Keyword::Module,
"mut" => Keyword::Mut,
Expand Down
Loading

0 comments on commit e08f4fa

Please sign in to comment.