diff options
author | David Li <li.davidm96@gmail.com> | 2017-11-04 19:18:49 -0400 |
---|---|---|
committer | David Li <li.davidm96@gmail.com> | 2017-11-04 19:18:49 -0400 |
commit | c9d3f7629cfdacededf2a92252e6c9de8a8b75ae (patch) | |
tree | 842a534556cdda149250c70bddd8a18d21ecd061 /src/ast.rs | |
parent | d756b309068eaf991290c39963462efec27ebe6f (diff) |
Parse unary operators
Diffstat (limited to 'src/ast.rs')
-rw-r--r-- | src/ast.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -35,6 +35,12 @@ impl<T> WithLocation<T> { pub struct Program(pub Box<WithLocation<Expression>>); #[derive(Debug)] +pub enum UnaryOp { + Pos, + Neg, +} + +#[derive(Debug)] pub enum BinOp { Add, Sub, @@ -45,6 +51,7 @@ pub enum BinOp { #[derive(Debug)] pub enum Expression { + UnaryOp(UnaryOp, Box<WithLocation<Expression>>), BinOp(BinOp, Box<WithLocation<Expression>>, Box<WithLocation<Expression>>), Number(u64), Nil, |