Skip to content

Commit

Permalink
structs
Browse files Browse the repository at this point in the history
  • Loading branch information
nic-gaffney committed Sep 13, 2023
1 parent b81d5ef commit 2ab284b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions sloth/src/parser/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,8 @@ impl Display for BinaryOp {
pub enum UnaryOp {
Not,
Neg,

Reference,
Dereference,
// Reference,
// Dereference,
}

impl TryFrom<TokenType> for UnaryOp {
Expand All @@ -449,9 +448,8 @@ impl TryFrom<TokenType> for UnaryOp {
TokenType::Bang => Self::Not,
TokenType::Minus => Self::Neg,

TokenType::Star => Self::Reference,
TokenType::At => Self::Dereference,

// TokenType::Star => Self::Reference,
// TokenType::At => Self::Dereference,
_ => return Err(ParsingError::InvalidOp),
};

Expand All @@ -464,9 +462,8 @@ impl Display for UnaryOp {
let value = match self {
UnaryOp::Not => "!",
UnaryOp::Neg => "-",

UnaryOp::Reference => "*",
UnaryOp::Dereference => "@",
// UnaryOp::Reference => "*",
// UnaryOp::Dereference => "@",
};

write!(f, "{value}")
Expand Down

0 comments on commit 2ab284b

Please sign in to comment.