knave-expand 0.14.21

The reading, scoping and expansion stages of knave
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::builtin_site::BuiltinSite;
use super::limit_problems::LimitProblems;
use crate::diagnostic::Diagnostic;
use crate::source::Span;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct NotesTooLarge {
    pub held_bytes: usize,
    pub limit: usize,
}

impl NotesTooLarge {
    pub fn at(self, function: &'static str, span: Span) -> Diagnostic {
        let site = BuiltinSite { function, span };
        LimitProblems::module_notes_too_large(site, self.held_bytes, self.limit)
    }
}