From 8a3f59e9c058d02016426fd3deec0992257f717e Mon Sep 17 00:00:00 2001 From: collin Date: Mon, 7 Sep 2020 23:40:15 -0700 Subject: [PATCH 1/2] remove types from console.log and formatted strings --- compiler/src/value/integer/integer.rs | 2 +- compiler/src/value/value.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/value/integer/integer.rs b/compiler/src/value/integer/integer.rs index 7d7bc32c22..40b1a6634b 100644 --- a/compiler/src/value/integer/integer.rs +++ b/compiler/src/value/integer/integer.rs @@ -60,7 +60,7 @@ impl fmt::Display for Integer { let integer = self; let option = match_integer!(integer => integer.get_value()); match option { - Some(number) => write!(f, "{}{}", number, self.get_type()), + Some(number) => write!(f, "{}", number), None => write!(f, "[input]{}", self.get_type()), } } diff --git a/compiler/src/value/value.rs b/compiler/src/value/value.rs index 57e4df3f89..ae96a7a7dd 100644 --- a/compiler/src/value/value.rs +++ b/compiler/src/value/value.rs @@ -334,9 +334,9 @@ impl> fmt::Display for ConstrainedValue write!(f, "{}", value), - ConstrainedValue::Mutable(ref value) => write!(f, "mut {}", value), - ConstrainedValue::Static(ref value) => write!(f, "static {}", value), - ConstrainedValue::Unresolved(ref value) => write!(f, "unresolved {}", value), + ConstrainedValue::Mutable(ref value) => write!(f, "{}", value), + ConstrainedValue::Static(ref value) => write!(f, "{}", value), + ConstrainedValue::Unresolved(ref value) => write!(f, "{}", value), } } } From d2810f278997a65f12caed08cebb4cc2eb95365d Mon Sep 17 00:00:00 2001 From: collin Date: Thu, 10 Sep 2020 11:18:49 -0700 Subject: [PATCH 2/2] fix tests --- compiler/tests/array/output/registers_ones.out | 2 +- compiler/tests/array/output/registers_zeros.out | 2 +- compiler/tests/function/output/newlines.out | 4 ++-- compiler/tests/statements/conditional/mod.rs | 4 ++-- .../tests/statements/conditional/output/registers_one.out | 2 ++ .../tests/statements/conditional/output/registers_zero.out | 2 ++ .../tests/statements/conditional/output_/registers_one.out | 2 -- .../tests/statements/conditional/output_/registers_zero.out | 2 -- 8 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 compiler/tests/statements/conditional/output/registers_one.out create mode 100644 compiler/tests/statements/conditional/output/registers_zero.out delete mode 100644 compiler/tests/statements/conditional/output_/registers_one.out delete mode 100644 compiler/tests/statements/conditional/output_/registers_zero.out diff --git a/compiler/tests/array/output/registers_ones.out b/compiler/tests/array/output/registers_ones.out index d7aaafed88..c6a97c7fd7 100644 --- a/compiler/tests/array/output/registers_ones.out +++ b/compiler/tests/array/output/registers_ones.out @@ -1,2 +1,2 @@ [registers] -r: [u8; (3)] = [1u8, 1u8, 1u8]; +r: [u8; (3)] = [1, 1, 1]; diff --git a/compiler/tests/array/output/registers_zeros.out b/compiler/tests/array/output/registers_zeros.out index d6278e3b69..e8c21bb46a 100644 --- a/compiler/tests/array/output/registers_zeros.out +++ b/compiler/tests/array/output/registers_zeros.out @@ -1,2 +1,2 @@ [registers] -r: [u8; (3)] = [0u8, 0u8, 0u8]; +r: [u8; (3)] = [0, 0, 0]; diff --git a/compiler/tests/function/output/newlines.out b/compiler/tests/function/output/newlines.out index e6563e6a1b..197a64cc63 100644 --- a/compiler/tests/function/output/newlines.out +++ b/compiler/tests/function/output/newlines.out @@ -1,3 +1,3 @@ [registers] -a: u32 = 0u32; -b: u32 = 0u32; +a: u32 = 0; +b: u32 = 0; diff --git a/compiler/tests/statements/conditional/mod.rs b/compiler/tests/statements/conditional/mod.rs index 532dbbff7d..9b6ae2fe2b 100644 --- a/compiler/tests/statements/conditional/mod.rs +++ b/compiler/tests/statements/conditional/mod.rs @@ -190,14 +190,14 @@ fn test_nested() { } fn output_one(program: EdwardsTestCompiler) { - let expected = include_bytes!("output_/registers_one.out"); + let expected = include_bytes!("output/registers_one.out"); let actual = get_output(program); assert_eq!(expected, actual.bytes().as_slice()); } fn output_zero(program: EdwardsTestCompiler) { - let expected = include_bytes!("output_/registers_zero.out"); + let expected = include_bytes!("output/registers_zero.out"); let actual = get_output(program); assert_eq!(expected, actual.bytes().as_slice()); diff --git a/compiler/tests/statements/conditional/output/registers_one.out b/compiler/tests/statements/conditional/output/registers_one.out new file mode 100644 index 0000000000..be39f343fa --- /dev/null +++ b/compiler/tests/statements/conditional/output/registers_one.out @@ -0,0 +1,2 @@ +[registers] +a: u32 = 1; diff --git a/compiler/tests/statements/conditional/output/registers_zero.out b/compiler/tests/statements/conditional/output/registers_zero.out new file mode 100644 index 0000000000..ae20e35199 --- /dev/null +++ b/compiler/tests/statements/conditional/output/registers_zero.out @@ -0,0 +1,2 @@ +[registers] +a: u32 = 0; diff --git a/compiler/tests/statements/conditional/output_/registers_one.out b/compiler/tests/statements/conditional/output_/registers_one.out deleted file mode 100644 index 663014ef39..0000000000 --- a/compiler/tests/statements/conditional/output_/registers_one.out +++ /dev/null @@ -1,2 +0,0 @@ -[registers] -a: u32 = 1u32; diff --git a/compiler/tests/statements/conditional/output_/registers_zero.out b/compiler/tests/statements/conditional/output_/registers_zero.out deleted file mode 100644 index fb12d4d334..0000000000 --- a/compiler/tests/statements/conditional/output_/registers_zero.out +++ /dev/null @@ -1,2 +0,0 @@ -[registers] -a: u32 = 0u32;