added some tests

This commit is contained in:
0rphon 2022-06-16 12:06:46 -07:00
parent 2181672b60
commit ed9ca4d6d8
28 changed files with 1878 additions and 76 deletions

View File

@ -0,0 +1,50 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: i128, b: i128) -> bool {
// unary
let c: i128 = a.abs();
let d: i128 = a.abs_wrapped();
let g: i128 = a.neg();
let h: i128 = a.not();
// binary
let j: i128 = a.add(b);
let k: i128 = a.add_wrapped(b);
let l: i128 = a.and(b);
let m: i128 = a.div(b);
let n: i128 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: i128 = a.mul(b);
let u: i128 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: i128 = a.or(b);
let z: i128 = a.pow(2u8);
let aa: i128 = a.pow(2u16);
let ab: i128 = a.pow(2u32);
let ac: i128 = a.pow_wrapped(2u8);
let ad: i128 = a.pow_wrapped(2u16);
let ae: i128 = a.pow_wrapped(2u32);
let af: i128 = a.shl(2u8);
let ag: i128 = a.shl(2u16);
let ah: i128 = a.shl(2u32);
let ai: i128 = a.shl_wrapped(2u8);
let aj: i128 = a.shl_wrapped(2u16);
let ak: i128 = a.shl_wrapped(2u32);
let al: i128 = a.shr(2u8);
let am: i128 = a.shr(2u16);
let an: i128 = a.shr(2u32);
let ao: i128 = a.shr_wrapped(2u8);
let ap: i128 = a.shr_wrapped(2u16);
let aq: i128 = a.shr_wrapped(2u32);
let ar: i128 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,50 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: i16, b: i16) -> bool {
// unary
let c: i16 = a.abs();
let d: i16 = a.abs_wrapped();
let g: i16 = a.neg();
let h: i16 = a.not();
// binary
let j: i16 = a.add(b);
let k: i16 = a.add_wrapped(b);
let l: i16 = a.and(b);
let m: i16 = a.div(b);
let n: i16 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: i16 = a.mul(b);
let u: i16 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: i16 = a.or(b);
let z: i16 = a.pow(2u8);
let aa: i16 = a.pow(2u16);
let ab: i16 = a.pow(2u32);
let ac: i16 = a.pow_wrapped(2u8);
let ad: i16 = a.pow_wrapped(2u16);
let ae: i16 = a.pow_wrapped(2u32);
let af: i16 = a.shl(2u8);
let ag: i16 = a.shl(2u16);
let ah: i16 = a.shl(2u32);
let ai: i16 = a.shl_wrapped(2u8);
let aj: i16 = a.shl_wrapped(2u16);
let ak: i16 = a.shl_wrapped(2u32);
let al: i16 = a.shr(2u8);
let am: i16 = a.shr(2u16);
let an: i16 = a.shr(2u32);
let ao: i16 = a.shr_wrapped(2u8);
let ap: i16 = a.shr_wrapped(2u16);
let aq: i16 = a.shr_wrapped(2u32);
let ar: i16 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,50 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: i32, b: i32) -> bool {
// unary
let c: i32 = a.abs();
let d: i32 = a.abs_wrapped();
let g: i32 = a.neg();
let h: i32 = a.not();
// binary
let j: i32 = a.add(b);
let k: i32 = a.add_wrapped(b);
let l: i32 = a.and(b);
let m: i32 = a.div(b);
let n: i32 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: i32 = a.mul(b);
let u: i32 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: i32 = a.or(b);
let z: i32 = a.pow(2u8);
let aa: i32 = a.pow(2u16);
let ab: i32 = a.pow(2u32);
let ac: i32 = a.pow_wrapped(2u8);
let ad: i32 = a.pow_wrapped(2u16);
let ae: i32 = a.pow_wrapped(2u32);
let af: i32 = a.shl(2u8);
let ag: i32 = a.shl(2u16);
let ah: i32 = a.shl(2u32);
let ai: i32 = a.shl_wrapped(2u8);
let aj: i32 = a.shl_wrapped(2u16);
let ak: i32 = a.shl_wrapped(2u32);
let al: i32 = a.shr(2u8);
let am: i32 = a.shr(2u16);
let an: i32 = a.shr(2u32);
let ao: i32 = a.shr_wrapped(2u8);
let ap: i32 = a.shr_wrapped(2u16);
let aq: i32 = a.shr_wrapped(2u32);
let ar: i32 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,50 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: i64, b: i64) -> bool {
// unary
let c: i64 = a.abs();
let d: i64 = a.abs_wrapped();
let g: i64 = a.neg();
let h: i64 = a.not();
// binary
let j: i64 = a.add(b);
let k: i64 = a.add_wrapped(b);
let l: i64 = a.and(b);
let m: i64 = a.div(b);
let n: i64 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: i64 = a.mul(b);
let u: i64 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: i64 = a.or(b);
let z: i64 = a.pow(2u8);
let aa: i64 = a.pow(2u16);
let ab: i64 = a.pow(2u32);
let ac: i64 = a.pow_wrapped(2u8);
let ad: i64 = a.pow_wrapped(2u16);
let ae: i64 = a.pow_wrapped(2u32);
let af: i64 = a.shl(2u8);
let ag: i64 = a.shl(2u16);
let ah: i64 = a.shl(2u32);
let ai: i64 = a.shl_wrapped(2u8);
let aj: i64 = a.shl_wrapped(2u16);
let ak: i64 = a.shl_wrapped(2u32);
let al: i64 = a.shr(2u8);
let am: i64 = a.shr(2u16);
let an: i64 = a.shr(2u32);
let ao: i64 = a.shr_wrapped(2u8);
let ap: i64 = a.shr_wrapped(2u16);
let aq: i64 = a.shr_wrapped(2u32);
let ar: i64 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,50 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: i8, b: i8) -> bool {
// unary
let c: i8 = a.abs();
let d: i8 = a.abs_wrapped();
let g: i8 = a.neg();
let h: i8 = a.not();
// binary
let j: i8 = a.add(b);
let k: i8 = a.add_wrapped(b);
let l: i8 = a.and(b);
let m: i8 = a.div(b);
let n: i8 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: i8 = a.mul(b);
let u: i8 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: i8 = a.or(b);
let z: i8 = a.pow(2u8);
let aa: i8 = a.pow(2u16);
let ab: i8 = a.pow(2u32);
let ac: i8 = a.pow_wrapped(2u8);
let ad: i8 = a.pow_wrapped(2u16);
let ae: i8 = a.pow_wrapped(2u32);
let af: i8 = a.shl(2u8);
let ag: i8 = a.shl(2u16);
let ah: i8 = a.shl(2u32);
let ai: i8 = a.shl_wrapped(2u8);
let aj: i8 = a.shl_wrapped(2u16);
let ak: i8 = a.shl_wrapped(2u32);
let al: i8 = a.shr(2u8);
let am: i8 = a.shr(2u16);
let an: i8 = a.shr(2u32);
let ao: i8 = a.shr_wrapped(2u8);
let ap: i8 = a.shr_wrapped(2u16);
let aq: i8 = a.shr_wrapped(2u32);
let ar: i8 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,49 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: u128, b: u128) -> bool {
// unary
let c: u128 = a.abs();
let d: u128 = a.abs_wrapped();
let h: u128 = a.not();
// binary
let j: u128 = a.add(b);
let k: u128 = a.add_wrapped(b);
let l: u128 = a.and(b);
let m: u128 = a.div(b);
let n: u128 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: u128 = a.mul(b);
let u: u128 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: u128 = a.or(b);
let z: u128 = a.pow(2u8);
let aa: u128 = a.pow(2u16);
let ab: u128 = a.pow(2u32);
let ac: u128 = a.pow_wrapped(2u8);
let ad: u128 = a.pow_wrapped(2u16);
let ae: u128 = a.pow_wrapped(2u32);
let af: u128 = a.shl(2u8);
let ag: u128 = a.shl(2u16);
let ah: u128 = a.shl(2u32);
let ai: u128 = a.shl_wrapped(2u8);
let aj: u128 = a.shl_wrapped(2u16);
let ak: u128 = a.shl_wrapped(2u32);
let al: u128 = a.shr(2u8);
let am: u128 = a.shr(2u16);
let an: u128 = a.shr(2u32);
let ao: u128 = a.shr_wrapped(2u8);
let ap: u128 = a.shr_wrapped(2u16);
let aq: u128 = a.shr_wrapped(2u32);
let ar: u128 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,55 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: u16, b: u16) -> bool {
// unary
let c: u16 = a.abs();
let d: u16 = a.abs_wrapped();
let h: u16 = a.not();
// binary
let j: u16 = a.add(b);
let k: u16 = a.add_wrapped(b);
let l: u16 = a.and(b);
let m: u16 = a.div(b);
let n: u16 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: u16 = a.mul(b);
let u: u16 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: u16 = a.or(b);
let z: u16 = a.pow(2u8);
let aa: u16 = a.pow(b);
let ab: u16 = a.pow(2u32);
let ac: u16 = a.pow_wrapped(2u8);
let ad: u16 = a.pow_wrapped(b);
let ae: u16 = a.pow_wrapped(2u32);
let af: u16 = a.shl(2u8);
let ag: u16 = a.shl(b);
let ah: u16 = a.shl(2u32);
let ai: u16 = a.shl_wrapped(2u8);
let aj: u16 = a.shl_wrapped(b);
let ak: u16 = a.shl_wrapped(2u32);
let al: u16 = a.shr(2u8);
let am: u16 = a.shr(b);
let an: u16 = a.shr(2u32);
let ao: u16 = a.shr_wrapped(2u8);
let ap: u16 = a.shr_wrapped(b);
let aq: u16 = a.shr_wrapped(2u32);
let ar: u16 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,55 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: u32, b: u32) -> bool {
// unary
let c: u32 = a.abs();
let d: u32 = a.abs_wrapped();
let h: u32 = a.not();
// binary
let j: u32 = a.add(b);
let k: u32 = a.add_wrapped(b);
let l: u32 = a.and(b);
let m: u32 = a.div(b);
let n: u32 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: u32 = a.mul(b);
let u: u32 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: u32 = a.or(b);
let z: u32 = a.pow(2u8);
let aa: u32 = a.pow(2u16);
let ab: u32 = a.pow(b);
let ac: u32 = a.pow_wrapped(2u8);
let ad: u32 = a.pow_wrapped(2u16);
let ae: u32 = a.pow_wrapped(b);
let af: u32 = a.shl(2u8);
let ag: u32 = a.shl(2u16);
let ah: u32 = a.shl(b);
let ai: u32 = a.shl_wrapped(2u8);
let aj: u32 = a.shl_wrapped(2u16);
let ak: u32 = a.shl_wrapped(b);
let al: u32 = a.shr(2u8);
let am: u32 = a.shr(2u16);
let an: u32 = a.shr(b);
let ao: u32 = a.shr_wrapped(2u8);
let ap: u32 = a.shr_wrapped(2u16);
let aq: u32 = a.shr_wrapped(b);
let ar: u32 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,49 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: u64, b: u64) -> bool {
// unary
let c: u64 = a.abs();
let d: u64 = a.abs_wrapped();
let h: u64 = a.not();
// binary
let j: u64 = a.add(b);
let k: u64 = a.add_wrapped(b);
let l: u64 = a.and(b);
let m: u64 = a.div(b);
let n: u64 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: u64 = a.mul(b);
let u: u64 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: u64 = a.or(b);
let z: u64 = a.pow(2u8);
let aa: u64 = a.pow(2u16);
let ab: u64 = a.pow(2u32);
let ac: u64 = a.pow_wrapped(2u8);
let ad: u64 = a.pow_wrapped(2u16);
let ae: u64 = a.pow_wrapped(2u32);
let af: u64 = a.shl(2u8);
let ag: u64 = a.shl(2u16);
let ah: u64 = a.shl(2u32);
let ai: u64 = a.shl_wrapped(2u8);
let aj: u64 = a.shl_wrapped(2u16);
let ak: u64 = a.shl_wrapped(2u32);
let al: u64 = a.shr(2u8);
let am: u64 = a.shr(2u16);
let an: u64 = a.shr(2u32);
let ao: u64 = a.shr_wrapped(2u8);
let ap: u64 = a.shr_wrapped(2u16);
let aq: u64 = a.shr_wrapped(2u32);
let ar: u64 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,49 @@
/*
namespace: Compile
expectation: Pass
input_file: inputs/add.in
*/
function main(a: u8, b: u8) -> bool {
// unary
let c: u8 = a.abs();
let d: u8 = a.abs_wrapped();
let h: u8 = a.not();
// binary
let j: u8 = a.add(b);
let k: u8 = a.add_wrapped(b);
let l: u8 = a.and(b);
let m: u8 = a.div(b);
let n: u8 = a.div_wrapped(b);
let o: bool = a.eq(b);
let p: bool = a.ge(b);
let q: bool = a.gt(b);
let r: bool = a.le(b);
let s: bool = a.lt(b);
let t: u8 = a.mul(b);
let u: u8 = a.mul_wrapped(b);
let w: bool = a.neq(b);
let y: u8 = a.or(b);
let z: u8 = a.pow(b);
let aa: u8 = a.pow(2u16);
let ab: u8 = a.pow(2u32);
let ac: u8 = a.pow_wrapped(b);
let ad: u8 = a.pow_wrapped(2u16);
let ae: u8 = a.pow_wrapped(2u32);
let af: u8 = a.shl(b);
let ag: u8 = a.shl(2u16);
let ah: u8 = a.shl(2u32);
let ai: u8 = a.shl_wrapped(b);
let aj: u8 = a.shl_wrapped(2u16);
let ak: u8 = a.shl_wrapped(2u32);
let al: u8 = a.shr(b);
let am: u8 = a.shr(2u16);
let an: u8 = a.shr(2u32);
let ao: u8 = a.shr_wrapped(b);
let ap: u8 = a.shr_wrapped(2u16);
let aq: u8 = a.shr_wrapped(2u32);
let ar: u8 = a.xor(b);
return a == b;
}

View File

@ -0,0 +1,146 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Abs
span:
lo: 0
hi: 7
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Abs
span:
lo: 0
hi: 7
op: Abs
span:
lo: 0
hi: 13
op: Abs
span:
lo: 0
hi: 19
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Abs
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Abs
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Abs
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Abs
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Abs
span:
lo: 1
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Abs
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Abs
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Abs
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Abs
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
op: Abs
span:
lo: 1
hi: 16

View File

@ -0,0 +1,146 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: AbsWrapped
span:
lo: 0
hi: 15
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: AbsWrapped
span:
lo: 0
hi: 15
op: AbsWrapped
span:
lo: 0
hi: 29
op: AbsWrapped
span:
lo: 0
hi: 43
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: AbsWrapped
span:
lo: 1
hi: 16
op: Negate
span:
lo: 0
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: AbsWrapped
span:
lo: 1
hi: 18
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: AbsWrapped
span:
lo: 2
hi: 17
op: Negate
span:
lo: 0
hi: 17
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: AbsWrapped
span:
lo: 2
hi: 17
op: Negate
span:
lo: 1
hi: 17
op: AbsWrapped
span:
lo: 1
hi: 32
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: AbsWrapped
span:
lo: 1
hi: 16
op: Not
span:
lo: 0
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: AbsWrapped
span:
lo: 1
hi: 18
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: AbsWrapped
span:
lo: 2
hi: 17
op: Not
span:
lo: 0
hi: 17
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: AbsWrapped
span:
lo: 2
hi: 17
op: Not
span:
lo: 1
hi: 17
op: AbsWrapped
span:
lo: 1
hi: 32

View File

@ -0,0 +1,146 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Double
span:
lo: 0
hi: 10
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Double
span:
lo: 0
hi: 10
op: Double
span:
lo: 0
hi: 19
op: Double
span:
lo: 0
hi: 28
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Double
span:
lo: 1
hi: 11
op: Negate
span:
lo: 0
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Double
span:
lo: 1
hi: 13
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Double
span:
lo: 2
hi: 12
op: Negate
span:
lo: 0
hi: 12
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Double
span:
lo: 2
hi: 12
op: Negate
span:
lo: 1
hi: 12
op: Double
span:
lo: 1
hi: 22
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Double
span:
lo: 1
hi: 11
op: Not
span:
lo: 0
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Double
span:
lo: 1
hi: 13
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Double
span:
lo: 2
hi: 12
op: Not
span:
lo: 0
hi: 12
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Double
span:
lo: 2
hi: 12
op: Not
span:
lo: 1
hi: 12
op: Double
span:
lo: 1
hi: 22

View File

@ -0,0 +1,146 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Inverse
span:
lo: 0
hi: 7
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Inverse
span:
lo: 0
hi: 7
op: Inverse
span:
lo: 0
hi: 13
op: Inverse
span:
lo: 0
hi: 19
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Inverse
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Inverse
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Inverse
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Inverse
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Inverse
span:
lo: 1
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Inverse
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Inverse
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Inverse
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Inverse
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
op: Inverse
span:
lo: 1
hi: 16

View File

@ -0,0 +1,205 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Negate
span:
lo: 0
hi: 2
- Unary:
receiver:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
arguments: []
span:
lo: 1
hi: 4
op: Negate
span:
lo: 0
hi: 4
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Negate
span:
lo: 0
hi: 3
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Negate
span:
lo: 0
hi: 3
- Unary:
receiver:
Value:
Integer:
- I8
- "5"
- span:
lo: 1
hi: 4
op: Negate
span:
lo: 0
hi: 4
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Negate
span:
lo: 0
hi: 7
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Negate
span:
lo: 0
hi: 7
op: Negate
span:
lo: 0
hi: 13
op: Negate
span:
lo: 0
hi: 19
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Negate
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Negate
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Negate
span:
lo: 1
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Negate
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Negate
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
op: Negate
span:
lo: 1
hi: 16

View File

@ -1,63 +0,0 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Negate
span:
lo: 0
hi: 2
- Unary:
receiver:
Call:
function:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
arguments: []
span:
lo: 1
hi: 4
op: Negate
span:
lo: 0
hi: 4
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Negate
span:
lo: 0
hi: 3
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Negate
span:
lo: 0
hi: 3
- Unary:
receiver:
Value:
Integer:
- I8
- "5"
- span:
lo: 1
hi: 4
op: Negate
span:
lo: 0
hi: 4

View File

@ -35,6 +35,57 @@ outputs:
span:
lo: 0
hi: 3
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"xx\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":4}\"}"
op: Not
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: Not
span:
lo: 0
hi: 10
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Not
span:
lo: 0
hi: 7
op: Not
span:
lo: 0
hi: 13
op: Not
span:
lo: 0
hi: 19
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Not
span:
lo: 1
hi: 8
op: Negate
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
@ -45,6 +96,96 @@ outputs:
lo: 1
hi: 3
op: Not
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 2
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 2
hi: 9
op: Negate
span:
lo: 1
hi: 9
op: Not
span:
lo: 1
hi: 16
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Not
span:
lo: 1
hi: 8
op: Not
span:
lo: 0
hi: 8
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Not
span:
lo: 1
hi: 10
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 2
hi: 9
op: Not
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 2
hi: 9
op: Not
span:
lo: 1
hi: 9
op: Not
span:
lo: 1
hi: 16

View File

@ -0,0 +1,158 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"xx\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":4}\"}"
op: SquareRoot
span:
lo: 2
hi: 11
op: Negate
span:
lo: 1
hi: 11
op: Not
span:
lo: 0
hi: 11
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: SquareRoot
span:
lo: 0
hi: 8
op: SquareRoot
span:
lo: 0
hi: 15
op: SquareRoot
span:
lo: 0
hi: 22
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: SquareRoot
span:
lo: 1
hi: 9
op: Negate
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: SquareRoot
span:
lo: 1
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: SquareRoot
span:
lo: 2
hi: 10
op: Negate
span:
lo: 0
hi: 10
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: SquareRoot
span:
lo: 2
hi: 10
op: Negate
span:
lo: 1
hi: 10
op: SquareRoot
span:
lo: 1
hi: 18
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: SquareRoot
span:
lo: 1
hi: 9
op: Not
span:
lo: 0
hi: 9
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: SquareRoot
span:
lo: 1
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: SquareRoot
span:
lo: 2
hi: 10
op: Not
span:
lo: 0
hi: 10
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: SquareRoot
span:
lo: 2
hi: 10
op: Not
span:
lo: 1
hi: 10
op: SquareRoot
span:
lo: 1
hi: 18

View File

@ -0,0 +1,158 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"xx\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":4}\"}"
op: Square
span:
lo: 2
hi: 13
op: Negate
span:
lo: 1
hi: 13
op: Not
span:
lo: 0
hi: 13
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: Square
span:
lo: 0
hi: 10
op: Square
span:
lo: 0
hi: 19
op: Square
span:
lo: 0
hi: 28
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Square
span:
lo: 1
hi: 11
op: Negate
span:
lo: 0
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Negate
span:
lo: 1
hi: 3
op: Square
span:
lo: 1
hi: 13
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Square
span:
lo: 2
hi: 12
op: Negate
span:
lo: 0
hi: 12
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Square
span:
lo: 2
hi: 12
op: Negate
span:
lo: 1
hi: 12
op: Square
span:
lo: 1
hi: 22
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":1,\\\"hi\\\":2}\"}"
op: Square
span:
lo: 1
hi: 11
op: Not
span:
lo: 0
hi: 11
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Not
span:
lo: 1
hi: 3
op: Square
span:
lo: 1
hi: 13
- Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Square
span:
lo: 2
hi: 12
op: Not
span:
lo: 0
hi: 12
- Unary:
receiver:
Unary:
receiver:
Unary:
receiver:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"lo\\\":2,\\\"hi\\\":3}\"}"
op: Square
span:
lo: 2
hi: 12
op: Not
span:
lo: 1
hi: 12
op: Square
span:
lo: 1
hi: 22

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
x.abs()
x.abs().abs().abs()
-x.abs()
(-x).abs()
-(x.abs())
(-x.abs()).abs()
!x.abs()
(!x).abs()
!(x.abs())
(!x.abs()).abs()

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
x.abs_wrapped()
x.abs_wrapped().abs_wrapped().abs_wrapped()
-x.abs_wrapped()
(-x).abs_wrapped()
-(x.abs_wrapped())
(-x.abs_wrapped()).abs_wrapped()
!x.abs_wrapped()
(!x).abs_wrapped()
!(x.abs_wrapped())
(!x.abs_wrapped()).abs_wrapped()

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
x.double()
x.double().double().double()
-x.double()
(-x).double()
-(x.double())
(-x.double()).double()
!x.double()
(!x).double()
!(x.double())
(!x.double()).double()

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
x.inv()
x.inv().inv().inv()
-x.inv()
(-x).inv()
-(x.inv())
(-x.inv()).inv()
!x.inv()
(!x).inv()
!(x.inv())
(!x.inv()).inv()

View File

@ -0,0 +1,22 @@
/*
namespace: ParseExpression
expectation: Pass
*/
-x
-x()
--x
-!x
-5i8
x.neg()
x.neg().neg().neg()
-x.neg()
(-x).neg()
-(x.neg())
(-x.neg()).neg()
!x.neg()
(!x).neg()
!(x.neg())
(!x.neg()).neg()

View File

@ -1,11 +0,0 @@
/*
namespace: ParseExpression
expectation: Pass
*/
-x
-x()
--x
-!x
-5i8

View File

@ -6,4 +6,15 @@ expectation: Pass
!x
!x()
!!x
!-x
!-xx.not()
x.not().not().not()
-x.not()
(-x).not()
-(x.not())
(-x.not()).not()
!x.not()
(!x).not()
!(x.not())
(!x.not()).not()

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-xx.sqrt()
x.sqrt().sqrt().sqrt()
-x.sqrt()
(-x).sqrt()
-(x.sqrt())
(-x.sqrt()).sqrt()
!x.sqrt()
(!x).sqrt()
!(x.sqrt())
(!x.sqrt()).sqrt()

View File

@ -0,0 +1,15 @@
/*
namespace: ParseExpression
expectation: Pass
*/
!-xx.square()
x.square().square().square()
-x.square()
(-x).square()
-(x.square())
(-x.square()).square()
!x.square()
(!x).square()
!(x.square())
(!x.square()).square()