From e2ef4f64e777f293a0408d0f60cfed9de69c7bb6 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 26 Jul 2020 17:28:43 +0200 Subject: =?UTF-8?q?Rename=20errors=20to=20problems=20and=20make=20error!?= =?UTF-8?q?=20macro=20more=20ergonomic=20=F0=9F=A7=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also adds a `warning!` macro. --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 4a92d096..b140f47d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ use toddle::{Font, OwnedData}; use toddle::query::{FontLoader, SharedFontLoader}; use toddle::query::{FontProvider, FontIndex, FontDescriptor}; -use crate::error::Error; +use crate::problem::Problems; use crate::layout::MultiLayout; use crate::style::{LayoutStyle, PageStyle, TextStyle}; use crate::syntax::{SyntaxModel, Scope, Decoration, ParseContext, parse}; @@ -43,7 +43,7 @@ macro_rules! pub_use_mod { } #[macro_use] -pub mod error; +pub mod problem; pub mod export; #[macro_use] pub mod func; @@ -175,8 +175,8 @@ impl Pass { /// User feedback data accumulated during a compilation pass. #[derive(Debug, Default, Clone, Eq, PartialEq)] pub struct Feedback { - /// Errors in the source. - pub errors: SpanVec, + /// Problems in the source code. + pub problems: Problems, /// Decorations of the source code for semantic syntax highlighting. pub decos: SpanVec, } @@ -185,7 +185,7 @@ impl Feedback { /// Create a new feedback instance without errors and decos. pub fn new() -> Feedback { Feedback { - errors: vec![], + problems: vec![], decos: vec![], } } @@ -198,14 +198,14 @@ impl Feedback { /// Add other feedback data to this feedback. pub fn extend(&mut self, other: Feedback) { - self.errors.extend(other.errors); + self.problems.extend(other.problems); self.decos.extend(other.decos); } /// Add more feedback whose spans are local and need to be offset by an /// `offset` to be correct for this feedbacks context. pub fn extend_offset(&mut self, offset: Position, other: Feedback) { - self.errors.extend(offset_spans(offset, other.errors)); + self.problems.extend(offset_spans(offset, other.problems)); self.decos.extend(offset_spans(offset, other.decos)); } } -- cgit v1.2.3