ast: Remove unary hash operator to reserve the symbol for use in attribute parsing

This commit is contained in:
John 2024-02-26 15:30:50 -06:00
parent cdf283064e
commit 59b73f314a
4 changed files with 1 additions and 6 deletions

View File

@ -367,8 +367,6 @@ pub enum UnaryKind {
/// Unused /// Unused
At, At,
/// Unused /// Unused
Hash,
/// Unused
Tilde, Tilde,
} }

View File

@ -367,7 +367,6 @@ mod display {
UnaryKind::Neg => "-", UnaryKind::Neg => "-",
UnaryKind::Not => "!", UnaryKind::Not => "!",
UnaryKind::At => "@", UnaryKind::At => "@",
UnaryKind::Hash => "#",
UnaryKind::Tilde => "~", UnaryKind::Tilde => "~",
} }
.fmt(f) .fmt(f)

View File

@ -551,8 +551,7 @@ pub mod interpret {
UnaryKind::Deref => todo!("Deref operator"), UnaryKind::Deref => todo!("Deref operator"),
UnaryKind::Neg => (-operand)?, UnaryKind::Neg => (-operand)?,
UnaryKind::Not => (!operand)?, UnaryKind::Not => (!operand)?,
UnaryKind::At => unimplemented!("At operator"), UnaryKind::At => {
UnaryKind::Hash => {
println!("{operand}"); println!("{operand}");
operand operand
} }

View File

@ -1215,7 +1215,6 @@ impl<'t> Parser<'t> {
Minus => Neg, // - Minus => Neg, // -
Bang => Not, // ! Bang => Not, // !
At => At, // @ At => At, // @
Hash => Hash, // #
Tilde => Tilde, // ~ Tilde => Tilde, // ~
}; };
} }