diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-02-04 19:22:23 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-02-04 19:22:23 +0100 |
| commit | e63ce52ae0d929506a1fa238477f039d14d53813 (patch) | |
| tree | 74dd8ce425dc368021c6495273acbdf2e736be68 /src/syntax/mod.rs | |
| parent | 5c11aa72239ecbdd9577f027bdc7e9468d68414e (diff) | |
Merge `Parsed` and `Layouted` types into `Pass` with `Feedback` 🌝🎢🌚
Diffstat (limited to 'src/syntax/mod.rs')
| -rw-r--r-- | src/syntax/mod.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index cfa4c2e5..8596a618 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -5,7 +5,8 @@ use std::fmt::Debug; use async_trait::async_trait; use serde::Serialize; -use crate::layout::{LayoutContext, Layouted, Commands, Command}; +use crate::{Pass, Feedback}; +use crate::layout::{LayoutContext, Commands, Command}; use self::span::{Spanned, SpanVec}; pub mod expr; @@ -25,10 +26,7 @@ mod test; pub trait Model: Debug + ModelBounds { /// Layout the model into a sequence of commands processed by a /// [`ModelLayouter`](crate::layout::ModelLayouter). - async fn layout<'a>( - &'a self, - ctx: LayoutContext<'_>, - ) -> Layouted<Commands<'a>>; + async fn layout<'a>(&'a self, ctx: LayoutContext<'_>) -> Pass<Commands<'a>>; } /// A tree representation of source code. @@ -52,14 +50,8 @@ impl SyntaxModel { #[async_trait(?Send)] impl Model for SyntaxModel { - async fn layout<'a>( - &'a self, - _: LayoutContext<'_>, - ) -> Layouted<Commands<'a>> { - Layouted { - output: vec![Command::LayoutSyntaxModel(self)], - errors: vec![], - } + async fn layout<'a>(&'a self, _: LayoutContext<'_>) -> Pass<Commands<'a>> { + Pass::new(vec![Command::LayoutSyntaxModel(self)], Feedback::new()) } } |
