summaryrefslogtreecommitdiff
path: root/src/chomp/ast/error.rs
blob: d2c49cd04ad65cc2e6219522fa318a321a2be0ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::{error::Error, fmt::{self, Display}};

use proc_macro2::Span;

use crate::chomp::Name;

use super::{Call, Parameter};

#[derive(Debug)]
pub enum SubstituteError {
    FreeParameter { param: Parameter, span: Option<Span>, name: Option<Name> },
    WrongArgCount { call: Call, expected: usize, span: Option<Span> },
}

impl From<SubstituteError> for syn::Error {
    fn from(e: SubstituteError) -> Self {
        todo!()
    }
}

impl Display for SubstituteError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        todo!()
    }
}

impl Error for SubstituteError {}