add bitwise op parsing, fix tests

This commit is contained in:
gluax 2022-06-16 15:40:48 -07:00
parent 94b506cf3f
commit c9ab4bd3d7
46 changed files with 8158 additions and 215 deletions

View File

@ -56,16 +56,16 @@ impl ParserContext<'_> {
/// Returns an [`Expression`] AST node if the next tokens represent
/// a ternary expression. May or may not include circuit init expressions.
///
/// Otherwise, tries to parse the next token using [`parse_disjunctive_expression`].
/// Otherwise, tries to parse the next token using [`parse_boolean_or_expression`].
pub(super) fn parse_conditional_expression(&mut self) -> Result<Expression> {
// Try to parse the next expression. Try BinaryOperation::Or.
let mut expr = self.parse_disjunctive_expression()?;
let mut expr = self.parse_boolean_or_expression()?;
// Parse the rest of the ternary expression.
if self.eat(&Token::Question) {
let if_true = self.parse_expression()?;
self.expect(&Token::Colon)?;
let if_false = self.parse_conditional_expression()?;
let if_false = self.parse_expression()?;
expr = Expression::Ternary(TernaryExpression {
span: expr.span() + if_false.span(),
condition: Box::new(expr),
@ -100,28 +100,20 @@ impl ParserContext<'_> {
Ok(expr)
}
/// Returns an [`Expression`] AST node if the next tokens represent
/// a binary OR expression.
///
/// Otherwise, tries to parse the next token using [`parse_conjunctive_expression`].
fn parse_disjunctive_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::Or], Self::parse_conjunctive_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// binary AND expression.
///
/// Otherwise, tries to parse the next token using [`parse_equality_expression`].
fn parse_conjunctive_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::And], Self::parse_shift_expression)
fn parse_boolean_and_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::And], Self::parse_equality_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// shift left or a shift right expression.
/// Returns an [`Expression`] AST node if the next tokens represent
/// a binary OR expression.
///
/// Otherwise, tries to parse the next token using [`parse_equality_expression`].
fn parse_shift_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::Shl, Token::Shr], Self::parse_equality_expression)
/// Otherwise, tries to parse the next token using [`parse_boolean_and_expression`].
fn parse_boolean_or_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::Or], Self::parse_boolean_and_expression)
}
/// Eats one of binary operators matching any in `tokens`.
@ -144,10 +136,24 @@ impl ParserContext<'_> {
Token::Exp => BinaryOperation::Pow,
Token::Shl => BinaryOperation::Shl,
Token::Shr => BinaryOperation::Shr,
Token::Xor => BinaryOperation::Xor,
_ => unreachable!("`eat_bin_op` shouldn't produce this"),
})
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// binary relational expression: less than, less than or equals, greater than, greater than or equals.
///
/// Otherwise, tries to parse the next token using [`parse_additive_expression`].
fn parse_ordering_expression(&mut self) -> Result<Expression> {
let mut expr = self.parse_bitwise_exclusive_or_expression()?;
if let Some(op) = self.eat_bin_op(&[Token::Lt, Token::LtEq, Token::Gt, Token::GtEq]) {
let right = self.parse_bitwise_exclusive_or_expression()?;
expr = Self::bin_expr(expr, right, op);
}
Ok(expr)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// binary equals or not equals expression.
///
@ -162,16 +168,35 @@ impl ParserContext<'_> {
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// binary relational expression: less than, less than or equals, greater than, greater than or equals.
/// bitwise exclusive or expression.
///
/// Otherwise, tries to parse the next token using [`parse_bitwise_inclusive_or_expression`].
fn parse_bitwise_exclusive_or_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::Xor], Self::parse_bitwise_inclusive_or_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// bitwise inclusive or expression.
///
/// Otherwise, tries to parse the next token using [`parse_bitwise_and_expression`].
fn parse_bitwise_inclusive_or_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::BitwiseOr], Self::parse_bitwise_and_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// bitwise and expression.
///
/// Otherwise, tries to parse the next token using [`parse_shift_expression`].
fn parse_bitwise_and_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::BitwiseAnd], Self::parse_shift_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a
/// shift left or a shift right expression.
///
/// Otherwise, tries to parse the next token using [`parse_additive_expression`].
fn parse_ordering_expression(&mut self) -> Result<Expression> {
let mut expr = self.parse_additive_expression()?;
if let Some(op) = self.eat_bin_op(&[Token::Lt, Token::LtEq, Token::Gt, Token::GtEq]) {
let right = self.parse_additive_expression()?;
expr = Self::bin_expr(expr, right, op);
}
Ok(expr)
fn parse_shift_expression(&mut self) -> Result<Expression> {
self.parse_bin_expr(&[Token::Shl, Token::Shr], Self::parse_additive_expression)
}
/// Returns an [`Expression`] AST node if the next tokens represent a

View File

@ -300,6 +300,7 @@ impl Token {
'{' => return single(&mut input, Token::LeftCurly),
'}' => return single(&mut input, Token::RightCurly),
'|' => return followed_by(&mut input, '|', Token::Or, Token::BitwiseOr),
'^' => return single(&mut input, Token::Xor),
_ => (),
}
if let Some(ident) = eat_identifier(&mut input) {

View File

@ -68,6 +68,7 @@ pub enum Token {
Shl,
Shr,
Underscore,
Xor,
// Syntactic Grammar
// Types
@ -234,6 +235,7 @@ impl fmt::Display for Token {
Shl => write!(f, "<<"),
Shr => write!(f, ">>"),
Underscore => write!(f, "_"),
Xor => write!(f, "^"),
Address => write!(f, "address"),
Bool => write!(f, "bool"),

View File

@ -64,7 +64,7 @@ impl<'a> ExpressionVisitorDirector<'a> for Director<'a> {
fn visit_identifier(&mut self, input: &'a Identifier, expected: &Self::AdditionalInput) -> Option<Self::Output> {
if let VisitResult::VisitChildren = self.visitor.visit_identifier(input) {
return if let Some(var) = self.visitor.symbol_table.clone().lookup_variable(&input.name) {
Some(self.visitor.assert_expected_option(*var.type_, expected, var.span))
Some(self.visitor.assert_expected_option(*var.type_, expected, input.span))
} else {
self.visitor
.handler

View File

@ -23,5 +23,5 @@ function main(a: field, b: field) -> bool {
let w: bool = a.neq(b);
let z: field = a.pow(b);
return f;
return w;
}

View File

@ -14,7 +14,7 @@ function main(a: scalar, b: scalar) -> bool {
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: group = 2group.mul(b);
let u: group = a.mul(2scalar);
let u: group = a.mul(2group);
let w: bool = a.neq(b);
return a == b;

View File

@ -0,0 +1,8 @@
---
namespace: Compile
expectation: Pass
outputs:
- output:
- initial_input_ast: ed65ff9337fc5a00cd28d780a985bcb05de7d0e5fe02b555774984552f0c14e8
initial_ast: 64b4179c6d21058f1e4a91826cd91364f7011e35e5e30a1d9dbc899ec3b500df
symbol_table: b736692dc7bdc91c5a808a20a3965f4c8ed2c46c212696d33fc6dd4cfc9a5844

View File

@ -0,0 +1,11 @@
---
namespace: Compile
expectation: Pass
outputs:
- output:
- initial_input_ast: b60204e9191bfb24680632af160fc62316e8b8043c0e3908c157855cc5547eb3
- initial_input_ast: 023263dbb2c455cbc5507aa39f8de80d8d1dbdce22e979302f29046261206ee4
- initial_input_ast: a4ec20e71f9401cb0f085770a98cbafb7ca39b4606215cd044ab413790653294
- initial_input_ast: a90726f08c89ae8eeb4becffd30d13acaa925902d2a29b59842dfc9ee8dc2e3a
initial_ast: f2dc2d3b4b6518f0cd974ab0b40df2da8dc5bd90622d52d49139db474b07c18d
symbol_table: e6f7abfd330837d1c643b6b7465c02333b1c895e3e6f624085e8e956ab6e5fe5

View File

@ -0,0 +1,8 @@
---
namespace: Compile
expectation: Pass
outputs:
- output:
- initial_input_ast: 3978a104614091782e13f81b70bf30ca139b67f82027af85985bf1b49defee87
initial_ast: 96b1ea298e6183a3b2a46b43987dd69fc84efe251cd560b693f33150f2c29776
symbol_table: d5152dab4bfbb282b7c2f3cc1acf94af36371e8e15207ee0d4b5cd5f074751c1

View File

@ -0,0 +1,8 @@
---
namespace: Compile
expectation: Pass
outputs:
- output:
- initial_input_ast: 2b6895ba1627e6a4dc444f814e2f6a0134ffdde243017e8dd23009081a15c95b
initial_ast: 18a8fedc09e15279ce70faef90308566a6359f7c692ceaa1959a2fd3c2672cde
symbol_table: 3eec749e9dd6f72ae053f0af3753be405331fdf01739a80df8b1a90c03923d27

View File

@ -0,0 +1,8 @@
---
namespace: Compile
expectation: Pass
outputs:
- output:
- initial_input_ast: 388c31e3ae19c196388f2a8dfa9b51b916f888e624f46b55ee59ba591d853467
initial_ast: 9bf5d4419e706e9cb15ab6099cb077f163673416179089726462dff2d0f4b6f1
symbol_table: 40b5ed9367dab2e80bd2b18c395213ff61712b8452edf019b3f3dc6498022828

View File

@ -240,3 +240,242 @@ outputs:
span:
lo: 0
hi: 33
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Add
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Add
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Add
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Add
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Add
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Add
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Add
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Add
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Add
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Add
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Add
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Add
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Add
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Add
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Add
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Add
span:
lo: 12
hi: 20
op: Add
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: Add
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: Add
span:
lo: 37
hi: 45
op: Add
span:
lo: 26
hi: 45
op: Add
span:
lo: 1
hi: 46

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: AddWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: AddWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: AddWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: AddWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: AddWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: AddWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: AddWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: AddWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: AddWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: AddWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: AddWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: AddWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: AddWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: AddWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: AddWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":34,\\\"hi\\\":35}\"}"
op: AddWrapped
span:
lo: 20
hi: 36
op: Add
span:
lo: 1
hi: 36
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":50,\\\"hi\\\":51}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":64,\\\"hi\\\":65}\"}"
op: AddWrapped
span:
lo: 50
hi: 66
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":69,\\\"hi\\\":70}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":83,\\\"hi\\\":84}\"}"
op: AddWrapped
span:
lo: 69
hi: 85
op: Add
span:
lo: 50
hi: 85
op: AddWrapped
span:
lo: 1
hi: 86

View File

@ -72,3 +72,242 @@ outputs:
span:
lo: 0
hi: 17
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: BitwiseAnd
span:
lo: 12
hi: 20
op: Add
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: BitwiseAnd
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: BitwiseAnd
span:
lo: 37
hi: 45
op: Add
span:
lo: 26
hi: 45
op: BitwiseAnd
span:
lo: 1
hi: 46

View File

@ -0,0 +1,481 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 6
hi: 9
op: BitwiseAnd
span:
lo: 0
hi: 9
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 4
hi: 7
op: BitwiseAnd
span:
lo: 0
hi: 7
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseAnd
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseAnd
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseAnd
span:
lo: 6
hi: 15
op: BitwiseOr
span:
lo: 0
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: BitwiseOr
span:
lo: 0
hi: 21
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseAnd
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseAnd
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseAnd
span:
lo: 6
hi: 15
op: BitwiseOr
span:
lo: 0
hi: 15
right:
Binary:
left:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
right:
Value:
Integer:
- U8
- "5"
- span:
lo: 24
hi: 27
op: BitwiseAnd
span:
lo: 18
hi: 27
op: BitwiseOr
span:
lo: 0
hi: 27
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 30
hi: 33
op: BitwiseOr
span:
lo: 0
hi: 33
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: BitwiseAnd
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseAnd
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseAnd
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: BitwiseAnd
span:
lo: 12
hi: 20
op: BitwiseAnd
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: BitwiseAnd
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: BitwiseAnd
span:
lo: 37
hi: 45
op: BitwiseAnd
span:
lo: 26
hi: 45
op: BitwiseAnd
span:
lo: 1
hi: 46

View File

@ -0,0 +1,481 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 6
hi: 9
op: BitwiseOr
span:
lo: 0
hi: 9
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 4
hi: 7
op: BitwiseOr
span:
lo: 0
hi: 7
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseOr
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseOr
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseOr
span:
lo: 6
hi: 15
op: Xor
span:
lo: 0
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: Xor
span:
lo: 0
hi: 21
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseOr
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseOr
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: BitwiseOr
span:
lo: 6
hi: 15
op: Xor
span:
lo: 0
hi: 15
right:
Binary:
left:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
right:
Value:
Integer:
- U8
- "5"
- span:
lo: 24
hi: 27
op: BitwiseOr
span:
lo: 18
hi: 27
op: Xor
span:
lo: 0
hi: 27
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 30
hi: 33
op: Xor
span:
lo: 0
hi: 33
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseOr
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: BitwiseOr
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: BitwiseOr
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: BitwiseOr
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: BitwiseOr
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseOr
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseOr
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseOr
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: BitwiseOr
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: BitwiseOr
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: BitwiseOr
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseOr
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: BitwiseOr
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: BitwiseOr
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: BitwiseOr
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: BitwiseOr
span:
lo: 11
hi: 18
op: BitwiseOr
span:
lo: 1
hi: 18
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":23,\\\"hi\\\":24}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":28,\\\"hi\\\":29}\"}"
op: BitwiseOr
span:
lo: 23
hi: 30
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":38,\\\"hi\\\":39}\"}"
op: BitwiseOr
span:
lo: 33
hi: 40
op: BitwiseOr
span:
lo: 23
hi: 40
op: BitwiseOr
span:
lo: 1
hi: 41

View File

@ -0,0 +1,481 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 6
hi: 9
op: Xor
span:
lo: 0
hi: 9
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 4
hi: 7
op: Xor
span:
lo: 0
hi: 7
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Xor
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: Xor
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseAnd
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: BitwiseAnd
span:
lo: 12
hi: 21
op: Xor
span:
lo: 0
hi: 21
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Xor
span:
lo: 0
hi: 9
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
op: Xor
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: BitwiseAnd
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: BitwiseAnd
span:
lo: 12
hi: 21
op: Xor
span:
lo: 0
hi: 21
right:
Binary:
left:
Value:
Integer:
- U8
- "5"
- span:
lo: 24
hi: 27
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 30
hi: 33
op: BitwiseAnd
span:
lo: 24
hi: 33
op: Xor
span:
lo: 0
hi: 33
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Xor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Xor
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Xor
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Xor
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Xor
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Xor
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Xor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Xor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Xor
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Xor
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Xor
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Xor
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Xor
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Xor
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Xor
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Xor
span:
lo: 12
hi: 20
op: Xor
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: Xor
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: Xor
span:
lo: 37
hi: 45
op: Xor
span:
lo: 26
hi: 45
op: Xor
span:
lo: 1
hi: 46

View File

@ -128,3 +128,242 @@ outputs:
span:
lo: 0
hi: 23
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Div
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Div
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Div
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Div
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Div
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Div
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Div
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Div
span:
lo: 12
hi: 20
op: Div
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: Div
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: Div
span:
lo: 37
hi: 45
op: Div
span:
lo: 26
hi: 45
op: Div
span:
lo: 1
hi: 46

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Div
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Div
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Div
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Div
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Div
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Div
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Div
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Div
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Div
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Div
span:
lo: 12
hi: 20
op: Div
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: Div
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: Div
span:
lo: 37
hi: 45
op: Div
span:
lo: 26
hi: 45
op: Div
span:
lo: 1
hi: 46

View File

@ -198,3 +198,242 @@ outputs:
span:
lo: 0
hi: 48
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Eq
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: Eq
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: Eq
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Eq
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Eq
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Eq
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Eq
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Eq
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Eq
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Eq
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Eq
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Eq
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Eq
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Eq
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Eq
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Eq
span:
lo: 12
hi: 19
op: Eq
span:
lo: 1
hi: 19
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":24,\\\"hi\\\":25}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: Eq
span:
lo: 24
hi: 31
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":40,\\\"hi\\\":41}\"}"
op: Eq
span:
lo: 35
hi: 42
op: Eq
span:
lo: 24
hi: 42
op: Eq
span:
lo: 1
hi: 43

View File

@ -0,0 +1,334 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Ge
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 7
hi: 10
op: Ge
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Ge
span:
lo: 0
hi: 22
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Ge
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: Ge
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: Ge
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Ge
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Ge
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Ge
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Ge
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Ge
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Ge
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Ge
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Ge
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Ge
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Ge
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Ge
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Ge
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Ge
span:
lo: 12
hi: 19
op: Ge
span:
lo: 1
hi: 19
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":24,\\\"hi\\\":25}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: Ge
span:
lo: 24
hi: 31
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":40,\\\"hi\\\":41}\"}"
op: Ge
span:
lo: 35
hi: 42
op: Ge
span:
lo: 24
hi: 42
op: Ge
span:
lo: 1
hi: 43

View File

@ -0,0 +1,7 @@
---
namespace: ParseExpression
expectation: Fail
outputs:
- "did not consume all input: '>=' @ 1:12-14\n'3' @ 1:15-16\n'u8' @ 1:16-18\n"
- "did not consume all input: '>=' @ 1:12-14\n'3' @ 1:15-16\n'u8' @ 1:16-18\n"
- "did not consume all input: '>=' @ 1:24-26\n'5' @ 1:27-28\n'u8' @ 1:28-30\n'+' @ 1:31-32\n'6' @ 1:33-34\n'u8' @ 1:34-36\n"

View File

@ -93,3 +93,242 @@ outputs:
span:
lo: 0
hi: 21
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Gt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: Gt
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: Gt
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Gt
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Gt
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Gt
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Gt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Gt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Gt
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Gt
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Gt
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Gt
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Gt
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Gt
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Gt
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Gt
span:
lo: 11
hi: 18
op: Gt
span:
lo: 1
hi: 18
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":23,\\\"hi\\\":24}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":28,\\\"hi\\\":29}\"}"
op: Gt
span:
lo: 23
hi: 30
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":38,\\\"hi\\\":39}\"}"
op: Gt
span:
lo: 33
hi: 40
op: Gt
span:
lo: 23
hi: 40
op: Gt
span:
lo: 1
hi: 41

View File

@ -0,0 +1,334 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Le
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 7
hi: 10
op: Le
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Le
span:
lo: 0
hi: 22
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Le
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: Le
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: Le
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Le
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Le
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Le
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Le
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Le
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Le
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Le
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Le
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Le
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Le
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Le
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Le
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Le
span:
lo: 12
hi: 19
op: Le
span:
lo: 1
hi: 19
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":24,\\\"hi\\\":25}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: Le
span:
lo: 24
hi: 31
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":40,\\\"hi\\\":41}\"}"
op: Le
span:
lo: 35
hi: 42
op: Le
span:
lo: 24
hi: 42
op: Le
span:
lo: 1
hi: 43

View File

@ -0,0 +1,7 @@
---
namespace: ParseExpression
expectation: Fail
outputs:
- "did not consume all input: '<=' @ 1:12-14\n'3' @ 1:15-16\n'u8' @ 1:16-18\n"
- "did not consume all input: '<=' @ 1:12-14\n'3' @ 1:15-16\n'u8' @ 1:16-18\n"
- "did not consume all input: '<=' @ 1:24-26\n'5' @ 1:27-28\n'u8' @ 1:28-30\n'+' @ 1:31-32\n'6' @ 1:33-34\n'u8' @ 1:34-36\n"

View File

@ -93,3 +93,242 @@ outputs:
span:
lo: 0
hi: 21
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Lt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":5,\\\"hi\\\":6}\"}"
op: Lt
span:
lo: 0
hi: 7
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
op: Lt
span:
lo: 0
hi: 13
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: Lt
span:
lo: 0
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Lt
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Lt
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Lt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Lt
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Lt
span:
lo: 1
hi: 16
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Lt
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Lt
span:
lo: 1
hi: 10
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Lt
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Lt
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: Lt
span:
lo: 1
hi: 16
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Lt
span:
lo: 1
hi: 8
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":11,\\\"hi\\\":12}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Lt
span:
lo: 11
hi: 18
op: Lt
span:
lo: 1
hi: 18
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":23,\\\"hi\\\":24}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":28,\\\"hi\\\":29}\"}"
op: Lt
span:
lo: 23
hi: 30
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":38,\\\"hi\\\":39}\"}"
op: Lt
span:
lo: 33
hi: 40
op: Lt
span:
lo: 23
hi: 40
op: Lt
span:
lo: 1
hi: 41

View File

@ -205,3 +205,242 @@ outputs:
span:
lo: 0
hi: 36
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Mul
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Mul
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Mul
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Mul
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Mul
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Mul
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Mul
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Mul
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Mul
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Mul
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Mul
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Mul
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Mul
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Mul
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Mul
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":12,\\\"hi\\\":13}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Mul
span:
lo: 12
hi: 20
op: Mul
span:
lo: 1
hi: 20
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":26,\\\"hi\\\":27}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: Mul
span:
lo: 26
hi: 34
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":37,\\\"hi\\\":38}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":43,\\\"hi\\\":44}\"}"
op: Mul
span:
lo: 37
hi: 45
op: Mul
span:
lo: 26
hi: 45
op: Mul
span:
lo: 1
hi: 46

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: MulWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: MulWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: MulWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: MulWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: MulWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: MulWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: MulWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: MulWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: MulWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: MulWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: MulWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: MulWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: MulWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: MulWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: MulWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":34,\\\"hi\\\":35}\"}"
op: MulWrapped
span:
lo: 20
hi: 36
op: Mul
span:
lo: 1
hi: 36
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":50,\\\"hi\\\":51}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":64,\\\"hi\\\":65}\"}"
op: MulWrapped
span:
lo: 50
hi: 66
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":69,\\\"hi\\\":70}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":83,\\\"hi\\\":84}\"}"
op: MulWrapped
span:
lo: 69
hi: 85
op: Mul
span:
lo: 50
hi: 85
op: MulWrapped
span:
lo: 1
hi: 86

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nand
span:
lo: 2
hi: 11
op: Negate
span:
lo: 1
hi: 11
op: Not
span:
lo: 0
hi: 11
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Nand
span:
lo: 0
hi: 9
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: Nand
span:
lo: 0
hi: 17
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":23,\\\"hi\\\":24}\"}"
op: Nand
span:
lo: 0
hi: 25
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nand
span:
lo: 1
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":10,\\\"hi\\\":11}\"}"
op: Nand
span:
lo: 1
hi: 12
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nand
span:
lo: 2
hi: 11
op: Negate
span:
lo: 0
hi: 11
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nand
span:
lo: 2
hi: 11
op: Negate
span:
lo: 1
hi: 11
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Nand
span:
lo: 1
hi: 20
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nand
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":10,\\\"hi\\\":11}\"}"
op: Nand
span:
lo: 1
hi: 12
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nand
span:
lo: 2
hi: 11
op: Not
span:
lo: 0
hi: 11
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nand
span:
lo: 2
hi: 11
op: Not
span:
lo: 1
hi: 11
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":18,\\\"hi\\\":19}\"}"
op: Nand
span:
lo: 1
hi: 20
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nand
span:
lo: 1
hi: 10
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Nand
span:
lo: 13
hi: 22
op: BitwiseAnd
span:
lo: 1
hi: 22
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":36,\\\"hi\\\":37}\"}"
op: Nand
span:
lo: 29
hi: 38
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":41,\\\"hi\\\":42}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":48,\\\"hi\\\":49}\"}"
op: Nand
span:
lo: 41
hi: 50
op: BitwiseAnd
span:
lo: 29
hi: 50
op: Nand
span:
lo: 1
hi: 51

View File

@ -0,0 +1,439 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Neq
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 5
hi: 8
op: Neq
span:
lo: 0
hi: 8
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Lt
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Lt
span:
lo: 13
hi: 22
op: Neq
span:
lo: 0
hi: 22
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Lt
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Lt
span:
lo: 13
hi: 22
op: Neq
span:
lo: 0
hi: 22
right:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 26
hi: 29
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 32
hi: 35
op: Lt
span:
lo: 26
hi: 35
right:
Binary:
left:
Value:
Integer:
- U8
- "5"
- span:
lo: 39
hi: 42
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 45
hi: 48
op: Lt
span:
lo: 39
hi: 48
op: Neq
span:
lo: 26
hi: 48
op: Or
span:
lo: 0
hi: 48
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Neq
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Neq
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Neq
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Neq
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Neq
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Neq
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Neq
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Neq
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Neq
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Neq
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Neq
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Neq
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Neq
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Neq
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Neq
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Neq
span:
lo: 13
hi: 21
op: Neq
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Neq
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Neq
span:
lo: 39
hi: 47
op: Neq
span:
lo: 27
hi: 47
op: Neq
span:
lo: 1
hi: 48

View File

@ -0,0 +1,5 @@
---
namespace: ParseExpression
expectation: Fail
outputs:
- "Error [EPAR0370028]: Could not parse the implicit value: 1.\n --> test:1:1\n |\n 1 | 1 != 2 != 3\n | ^"

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Nor
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Nor
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Nor
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Nor
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nor
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nor
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Nor
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Nor
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Nor
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nor
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Nor
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Nor
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Nor
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Nor
span:
lo: 13
hi: 21
op: Neq
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Nor
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Nor
span:
lo: 39
hi: 47
op: Neq
span:
lo: 27
hi: 47
op: Nor
span:
lo: 1
hi: 48

View File

@ -5,164 +5,73 @@ outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
Boolean:
- "true"
- span:
lo: 0
hi: 3
hi: 4
right:
Value:
Integer:
- U8
- "1"
Boolean:
- "true"
- span:
lo: 6
hi: 9
op: Add
lo: 8
hi: 12
op: Or
span:
lo: 0
hi: 9
hi: 12
- Binary:
left:
Value:
Integer:
- U8
- "2"
Boolean:
- "false"
- span:
lo: 0
hi: 3
hi: 5
right:
Value:
Integer:
- U16
- "3"
Boolean:
- "true"
- span:
lo: 4
hi: 8
op: Add
lo: 7
hi: 11
op: Or
span:
lo: 0
hi: 8
hi: 11
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
Boolean:
- "true"
- span:
lo: 0
hi: 3
hi: 4
right:
Value:
Integer:
- U8
- "2"
Boolean:
- "false"
- span:
lo: 6
hi: 9
op: Add
hi: 11
op: Or
span:
lo: 0
hi: 9
hi: 11
right:
Value:
Integer:
- U8
- "3"
Boolean:
- "false"
- span:
lo: 12
hi: 15
op: Add
lo: 15
hi: 20
op: Or
span:
lo: 0
hi: 15
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Mul
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: Mul
span:
lo: 12
hi: 21
op: Add
span:
lo: 0
hi: 21
- Binary:
left:
Binary:
left:
Value:
Integer:
- I8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- I8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Value:
Integer:
- I8
- "3"
- span:
lo: 12
hi: 15
op: Sub
span:
lo: 0
hi: 15
hi: 20
- Binary:
left:
Binary:
@ -170,73 +79,86 @@ outputs:
Binary:
left:
Value:
Integer:
- U8
- "1"
Boolean:
- "true"
- span:
lo: 0
hi: 3
hi: 4
right:
Value:
Integer:
- U8
- "2"
Boolean:
- "false"
- span:
lo: 6
hi: 9
op: Mul
lo: 8
hi: 13
op: Or
span:
lo: 0
hi: 9
hi: 13
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 12
hi: 15
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 18
hi: 21
op: Mul
span:
lo: 12
hi: 21
op: Add
Value:
Boolean:
- "true"
- span:
lo: 17
hi: 21
op: Or
span:
lo: 0
hi: 21
right:
Value:
Boolean:
- "false"
- span:
lo: 25
hi: 30
op: Or
span:
lo: 0
hi: 30
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "5"
Boolean:
- "true"
- span:
lo: 24
hi: 27
lo: 0
hi: 4
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 30
hi: 33
op: Mul
Binary:
left:
Value:
Boolean:
- "true"
- span:
lo: 9
hi: 13
right:
Value:
Boolean:
- "false"
- span:
lo: 17
hi: 22
op: Or
span:
lo: 9
hi: 22
op: Or
span:
lo: 24
hi: 33
op: Sub
lo: 0
hi: 22
right:
Value:
Boolean:
- "true"
- span:
lo: 27
hi: 31
op: Or
span:
lo: 0
hi: 33
hi: 31

View File

@ -0,0 +1,320 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Pow
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 5
hi: 8
op: Pow
span:
lo: 0
hi: 8
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 7
hi: 10
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 14
hi: 17
op: Pow
span:
lo: 7
hi: 17
op: Pow
span:
lo: 0
hi: 17
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Pow
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Pow
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Pow
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Pow
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Pow
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Pow
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Pow
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Pow
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Pow
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Pow
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Pow
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Pow
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Pow
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Pow
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Pow
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Pow
span:
lo: 13
hi: 21
op: Pow
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Pow
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Pow
span:
lo: 39
hi: 47
op: Pow
span:
lo: 27
hi: 47
op: Pow
span:
lo: 1
hi: 48

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: PowWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: PowWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: PowWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: PowWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: PowWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: PowWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: PowWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: PowWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: PowWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: PowWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: PowWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: PowWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: PowWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: PowWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: PowWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":21,\\\"hi\\\":22}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
op: PowWrapped
span:
lo: 21
hi: 37
op: Pow
span:
lo: 1
hi: 37
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":51,\\\"hi\\\":52}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":65,\\\"hi\\\":66}\"}"
op: PowWrapped
span:
lo: 51
hi: 67
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":71,\\\"hi\\\":72}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":85,\\\"hi\\\":86}\"}"
op: PowWrapped
span:
lo: 71
hi: 87
op: Pow
span:
lo: 51
hi: 87
op: PowWrapped
span:
lo: 1
hi: 88

View File

@ -0,0 +1,481 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Shl
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 5
hi: 8
op: Shl
span:
lo: 0
hi: 8
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 7
hi: 10
op: Shl
span:
lo: 0
hi: 10
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 14
hi: 17
op: Shl
span:
lo: 0
hi: 17
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Shl
span:
lo: 0
hi: 22
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 7
hi: 10
op: Shl
span:
lo: 0
hi: 10
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 14
hi: 17
op: Shl
span:
lo: 0
hi: 17
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Shl
span:
lo: 0
hi: 22
right:
Binary:
left:
Value:
Integer:
- U8
- "5"
- span:
lo: 26
hi: 29
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 32
hi: 35
op: Add
span:
lo: 26
hi: 35
op: Shl
span:
lo: 0
hi: 35
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shl
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Shl
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Shl
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Shl
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shl
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Shl
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shl
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shl
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Shl
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shl
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Shl
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shl
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shl
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Shl
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shl
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Shl
span:
lo: 13
hi: 21
op: Shl
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Shl
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Shl
span:
lo: 39
hi: 47
op: Shl
span:
lo: 27
hi: 47
op: Shl
span:
lo: 1
hi: 48

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShlWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: ShlWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: ShlWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: ShlWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShlWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: ShlWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShlWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShlWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: ShlWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShlWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: ShlWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShlWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShlWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: ShlWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShlWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":21,\\\"hi\\\":22}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
op: ShlWrapped
span:
lo: 21
hi: 37
op: Shl
span:
lo: 1
hi: 37
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":51,\\\"hi\\\":52}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":65,\\\"hi\\\":66}\"}"
op: ShlWrapped
span:
lo: 51
hi: 67
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":71,\\\"hi\\\":72}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":85,\\\"hi\\\":86}\"}"
op: ShlWrapped
span:
lo: 71
hi: 87
op: Shl
span:
lo: 51
hi: 87
op: ShlWrapped
span:
lo: 1
hi: 88

View File

@ -0,0 +1,481 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "1"
- span:
lo: 7
hi: 10
op: Shr
span:
lo: 0
hi: 10
- Binary:
left:
Value:
Integer:
- U8
- "2"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 5
hi: 8
op: Shr
span:
lo: 0
hi: 8
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 7
hi: 10
op: Shr
span:
lo: 0
hi: 10
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 14
hi: 17
op: Shr
span:
lo: 0
hi: 17
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Shr
span:
lo: 0
hi: 22
- Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 7
hi: 10
op: Shr
span:
lo: 0
hi: 10
right:
Value:
Integer:
- U8
- "3"
- span:
lo: 14
hi: 17
op: Shr
span:
lo: 0
hi: 17
- Binary:
left:
Binary:
left:
Binary:
left:
Value:
Integer:
- U8
- "1"
- span:
lo: 0
hi: 3
right:
Value:
Integer:
- U8
- "2"
- span:
lo: 6
hi: 9
op: Add
span:
lo: 0
hi: 9
right:
Binary:
left:
Value:
Integer:
- U8
- "3"
- span:
lo: 13
hi: 16
right:
Value:
Integer:
- U8
- "4"
- span:
lo: 19
hi: 22
op: Add
span:
lo: 13
hi: 22
op: Shr
span:
lo: 0
hi: 22
right:
Binary:
left:
Value:
Integer:
- U8
- "5"
- span:
lo: 26
hi: 29
right:
Value:
Integer:
- U8
- "6"
- span:
lo: 32
hi: 35
op: Add
span:
lo: 26
hi: 35
op: Shr
span:
lo: 0
hi: 35
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shr
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Shr
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Shr
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Shr
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shr
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Shr
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shr
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shr
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Shr
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shr
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Shr
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shr
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Shr
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Shr
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Shr
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Shr
span:
lo: 13
hi: 21
op: Shr
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Shr
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Shr
span:
lo: 39
hi: 47
op: Shr
span:
lo: 27
hi: 47
op: Shr
span:
lo: 1
hi: 48

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShrWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: ShrWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: ShrWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: ShrWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShrWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: ShrWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShrWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShrWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: ShrWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShrWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: ShrWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShrWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: ShrWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: ShrWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: ShrWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":21,\\\"hi\\\":22}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
op: ShrWrapped
span:
lo: 21
hi: 37
op: Shr
span:
lo: 1
hi: 37
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":51,\\\"hi\\\":52}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":65,\\\"hi\\\":66}\"}"
op: ShrWrapped
span:
lo: 51
hi: 67
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":71,\\\"hi\\\":72}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":85,\\\"hi\\\":86}\"}"
op: ShrWrapped
span:
lo: 71
hi: 87
op: Shr
span:
lo: 51
hi: 87
op: ShrWrapped
span:
lo: 1
hi: 88

View File

@ -128,3 +128,242 @@ outputs:
span:
lo: 0
hi: 24
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Sub
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":6,\\\"hi\\\":7}\"}"
op: Sub
span:
lo: 0
hi: 8
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
op: Sub
span:
lo: 0
hi: 15
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":20,\\\"hi\\\":21}\"}"
op: Sub
span:
lo: 0
hi: 22
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Sub
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Sub
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Sub
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Sub
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Sub
span:
lo: 1
hi: 18
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Sub
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":9,\\\"hi\\\":10}\"}"
op: Sub
span:
lo: 1
hi: 11
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Sub
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":8,\\\"hi\\\":9}\"}"
op: Sub
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: Sub
span:
lo: 1
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":7,\\\"hi\\\":8}\"}"
op: Sub
span:
lo: 1
hi: 9
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":13,\\\"hi\\\":14}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":19,\\\"hi\\\":20}\"}"
op: Sub
span:
lo: 13
hi: 21
op: Shl
span:
lo: 1
hi: 21
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":27,\\\"hi\\\":28}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":33,\\\"hi\\\":34}\"}"
op: Sub
span:
lo: 27
hi: 35
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":39,\\\"hi\\\":40}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":45,\\\"hi\\\":46}\"}"
op: Sub
span:
lo: 39
hi: 47
op: Shl
span:
lo: 27
hi: 47
op: Sub
span:
lo: 1
hi: 48

View File

@ -0,0 +1,243 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: SubWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":14,\\\"hi\\\":15}\"}"
op: SubWrapped
span:
lo: 0
hi: 16
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":29,\\\"hi\\\":30}\"}"
op: SubWrapped
span:
lo: 0
hi: 31
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":44,\\\"hi\\\":45}\"}"
op: SubWrapped
span:
lo: 0
hi: 46
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: SubWrapped
span:
lo: 1
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: SubWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: SubWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: SubWrapped
span:
lo: 2
hi: 18
op: Negate
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: SubWrapped
span:
lo: 1
hi: 34
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: SubWrapped
span:
lo: 1
hi: 17
op: Not
span:
lo: 0
hi: 17
- Binary:
left:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":17,\\\"hi\\\":18}\"}"
op: SubWrapped
span:
lo: 1
hi: 19
- Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: SubWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 0
hi: 18
- Binary:
left:
Unary:
receiver:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":16,\\\"hi\\\":17}\"}"
op: SubWrapped
span:
lo: 2
hi: 18
op: Not
span:
lo: 1
hi: 18
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":32,\\\"hi\\\":33}\"}"
op: SubWrapped
span:
lo: 1
hi: 34
- Binary:
left:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":15,\\\"hi\\\":16}\"}"
op: SubWrapped
span:
lo: 1
hi: 17
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":21,\\\"hi\\\":22}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":35,\\\"hi\\\":36}\"}"
op: SubWrapped
span:
lo: 21
hi: 37
op: Shl
span:
lo: 1
hi: 37
right:
Binary:
left:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":51,\\\"hi\\\":52}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":65,\\\"hi\\\":66}\"}"
op: SubWrapped
span:
lo: 51
hi: 67
right:
Binary:
left:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":71,\\\"hi\\\":72}\"}"
right:
Identifier: "{\"name\":\"y\",\"span\":\"{\\\"lo\\\":85,\\\"hi\\\":86}\"}"
op: SubWrapped
span:
lo: 71
hi: 87
op: Shl
span:
lo: 51
hi: 87
op: SubWrapped
span:
lo: 1
hi: 88

View File

@ -41,19 +41,19 @@ outputs:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"xx\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":4}\"}"
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 2
hi: 10
hi: 9
op: Negate
span:
lo: 1
hi: 10
hi: 9
op: Not
span:
lo: 0
hi: 10
hi: 9
- Unary:
receiver:
Unary:

View File

@ -8,19 +8,19 @@ outputs:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"xx\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":4}\"}"
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Square
span:
lo: 2
hi: 13
hi: 12
op: Negate
span:
lo: 1
hi: 13
hi: 12
op: Not
span:
lo: 0
hi: 13
hi: 12
- Unary:
receiver:
Unary:

View File

@ -5,6 +5,6 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got ']'\n --> test:1:2\n |\n 1 | (];\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '['\n --> test:1:1\n |\n 1 | [);\n | ^"
- "Error [EPAR0370026]: Could not lex the following content: `\\y`.\n"
- "Error [EPAR0370005]: expected ) -- got '|'\n --> test:1:5\n |\n 1 | (x,y|;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got ';'\n --> test:1:6\n |\n 1 | (x,y|;\n | ^"
- "Error [EPAR0370005]: expected ; -- got '['\n --> test:1:2\n |\n 1 | x[};\n | ^"
- "Error [EPAR0370005]: expected ) -- got ']'\n --> test:1:6\n |\n 1 | (x, y];\n | ^"

View File

@ -56,7 +56,7 @@ outputs:
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x>==b;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:4\n |\n 1 | x<==b;\n | ^"
- "Error [EPAR0370005]: expected ; -- got '..'\n --> test:1:2\n |\n 1 | x..=b;\n | ^^"
- "Error [EPAR0370005]: expected ; -- got '&'\n --> test:1:2\n |\n 1 | x&=b;\n | ^"
- "Error [EPAR0370009]: unexpected string: expected 'expression', got '='\n --> test:1:3\n |\n 1 | x&=b;\n | ^"
- "Error [EPAR0370041]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x==b;\n | ^^^^^"
- "Error [EPAR0370041]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x!=b;\n | ^^^^^"
- "Error [EPAR0370041]: Expression statements are no longer supported.\n --> test:1:1\n |\n 1 | x>=b;\n | ^^^^^"

View File

@ -5,15 +5,15 @@ expectation: Pass
1u8 & 1u8
2u8&3
2u8&3u8
1u8 & 2u8 & 3u8
1u8 == 2u8 & 3u8 == 4u8
1u8 | 2u8 & 3u8 | 4u8
1u8 & 2u8 & 3u8
1u8 == 2u8 & 3u8 == 4u8 & 5u8 == 6u8
1u8 | 2u8 & 3u8 | 4u8 & 5u8 | 6u8
!-x.and(y)
x.and(y).and(y).and(y)