diff --git a/src/parser.rs b/src/parser.rs index 0b3d80f..4eea835 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -63,6 +63,7 @@ pub struct Assign<'a> { pub enum Operation<'a> { And { a: Expression<'a>, b: Expression<'a> }, Or { a: Expression<'a>, b: Expression<'a> }, + Xor { a: Expression<'a>, b: Expression<'a> }, Not(Expression<'a>), } @@ -113,6 +114,13 @@ fn operation(input: Span) -> IResult { b, }, ), + map( + separated_pair(ws0(expression_nonrecurse), char('^'), ws0(expression)), + |(a, b)| Operation::Xor { + a, + b, + }, + ), map( preceded(char('~'), expression), |expr| Operation::Not(expr),