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
At,
/// Unused
Hash,
/// Unused
Tilde,
}

View File

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

View File

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

View File

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