use std::collections::BTreeSet;
use crate::lexer::token::location::Location;
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum Error {
#[error("{location} Expected one of {expected:?}, found `{found}`")]
InvalidToken {
location: Location,
expected: Vec<&'static str>,
found: String,
},
#[error("{location} The identifier `{identifier}` is reserved")]
ReservedIdentifier {
location: Location,
identifier: String,
},
#[error("{location} Function `{identifier}` must have {expected} arguments, found {found}")]
InvalidNumberOfArguments {
location: Location,
identifier: String,
expected: usize,
found: usize,
},
#[error(
"{location} Objects must be named as '<name>' (deploy) and '<name>_deployed' (runtime)"
)]
InvalidObjectName {
location: Location,
expected: String,
found: String,
},
#[error("{location} Found invalid LLVM attributes: {values:?}")]
InvalidAttributes {
location: Location,
values: BTreeSet<String>,
},
#[error("The line or column length exceed the maximum of u32::MAX")]
InvalidLength,
}