mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 23:23:50 +03:00
Clean up error
This commit is contained in:
parent
8af0f6268f
commit
cf7bde5fab
@ -18,9 +18,9 @@ use crate::GroupLiteral;
|
||||
|
||||
use super::*;
|
||||
|
||||
/// A literal expression.
|
||||
/// A literal.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum LiteralExpression {
|
||||
pub enum Literal {
|
||||
// todo: deserialize values here
|
||||
/// An address literal, e.g., `aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8s7pyjh9`.
|
||||
Address(String, #[serde(with = "leo_span::span_json")] Span),
|
||||
@ -41,7 +41,7 @@ pub enum LiteralExpression {
|
||||
String(String, #[serde(with = "leo_span::span_json")] Span),
|
||||
}
|
||||
|
||||
impl fmt::Display for LiteralExpression {
|
||||
impl fmt::Display for Literal {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match &self {
|
||||
Self::Address(address, _) => write!(f, "{}", address),
|
||||
@ -55,7 +55,7 @@ impl fmt::Display for LiteralExpression {
|
||||
}
|
||||
}
|
||||
|
||||
impl Node for LiteralExpression {
|
||||
impl Node for Literal {
|
||||
fn span(&self) -> Span {
|
||||
match &self {
|
||||
Self::Address(_, span)
|
@ -61,12 +61,12 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// For when the type checker cannot find a type for an expression.
|
||||
/// For when the type checker cannot determine the type of an expression.
|
||||
@formatted
|
||||
could_not_find_type {
|
||||
could_not_determine_type {
|
||||
args: (expr: impl Display),
|
||||
msg: format!(
|
||||
"Could not find type for `{expr}`",
|
||||
"Could not determine the type of `{expr}`",
|
||||
),
|
||||
help: None,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user