diff --git a/CHANGELOG.md b/CHANGELOG.md index 6654ac45..fea7ecff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,16 @@ ### Added - **aiken-lang**: added optimization to help prevent unnecessary data wraps or unwraps +- **aiken-lang**: optimization to strip unnecessary lambdas +- **aiken-lang**: implement Clone for ParseError and tipo::Error for the playground - **aiken-project**: added end to end tests on conversion from aiken lang to uplc ### Fixed -- **aiken-lang**: Add name of var to the unused var warning - -### Fixed - - **aiken**: fixed 'new' instructions to properly show project name and folder +- **aiken-lang**: Add name of var to the unused var warning +- **aiken-lang**: fix expect on an empty list +- **aiken-lang**: pattern match on boolean with simple clause bodies ## v1.0.2.alpha - 2023-04-17 diff --git a/crates/aiken-lang/src/parser/error.rs b/crates/aiken-lang/src/parser/error.rs index e45b3bda..312fc95c 100644 --- a/crates/aiken-lang/src/parser/error.rs +++ b/crates/aiken-lang/src/parser/error.rs @@ -4,7 +4,7 @@ use miette::Diagnostic; use owo_colors::{OwoColorize, Stream::Stdout}; use std::collections::HashSet; -#[derive(Debug, Diagnostic, thiserror::Error)] +#[derive(Debug, Clone, Diagnostic, thiserror::Error)] #[error("{kind}\n")] pub struct ParseError { pub kind: ErrorKind, @@ -98,7 +98,7 @@ impl> chumsky::Error for ParseError { } } -#[derive(Debug, PartialEq, Eq, Diagnostic, thiserror::Error)] +#[derive(Debug, Clone, PartialEq, Eq, Diagnostic, thiserror::Error)] pub enum ErrorKind { #[error("I arrived at the end of the file unexpectedly.")] UnexpectedEnd, @@ -155,7 +155,7 @@ pub enum ErrorKind { InvalidWhenClause, } -#[derive(Debug, PartialEq, Eq, Hash, Diagnostic, thiserror::Error)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Diagnostic, thiserror::Error)] pub enum Pattern { #[error("I found an unexpected char '{0:?}'.")] #[diagnostic(help("Try removing it!"))] diff --git a/crates/aiken-lang/src/tipo/error.rs b/crates/aiken-lang/src/tipo/error.rs index 75118c5b..9f403ad1 100644 --- a/crates/aiken-lang/src/tipo/error.rs +++ b/crates/aiken-lang/src/tipo/error.rs @@ -15,14 +15,14 @@ use owo_colors::{ }; use std::{collections::HashMap, fmt::Display, sync::Arc}; -#[derive(Debug, thiserror::Error, Diagnostic)] +#[derive(Debug, thiserror::Error, Diagnostic, Clone)] #[error("Something is possibly wrong here...")] pub struct Snippet { #[label] pub location: Span, } -#[derive(Debug, thiserror::Error)] +#[derive(Debug, Clone, thiserror::Error)] #[error( "I don't know some of the labels used in this expression. I've highlighted them just below." )] @@ -53,7 +53,7 @@ impl Diagnostic for UnknownLabels { } } -#[derive(Debug, thiserror::Error, Diagnostic)] +#[derive(Debug, thiserror::Error, Diagnostic, Clone)] pub enum Error { #[error("I discovered a type cast from Data without an annotation")] #[diagnostic(code("illegal::type_cast"))]