From 78da2bdd5d77d1b8572e5e9da119bfa68127a3fa Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 21 Jan 2020 17:09:31 +0100 Subject: =?UTF-8?q?Decoupled=20function=20parser=20=F0=9F=94=97=20[WIP]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/mod.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/syntax/mod.rs') diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 75407f82..a77c764e 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -23,22 +23,6 @@ pub mod prelude { } -pub struct Parsed { - pub output: T, - pub errors: SpanVec, - pub decorations: SpanVec, -} - -impl Parsed { - pub fn map(self, f: F) -> Parsed where F: FnOnce(T) -> U { - Parsed { - output: f(self.output), - errors: self.errors, - decorations: self.decorations, - } - } -} - #[async_trait::async_trait(?Send)] pub trait Model: Debug + ModelBounds { async fn layout<'a>( @@ -110,7 +94,7 @@ impl SyntaxModel { #[async_trait::async_trait(?Send)] impl Model for SyntaxModel { - async fn layout<'a>(&'a self, ctx: LayoutContext<'_, '_>) -> Layouted> { + async fn layout<'a>(&'a self, _: LayoutContext<'_, '_>) -> Layouted> { Layouted { output: vec![Command::LayoutSyntaxModel(self)], errors: vec![], @@ -153,7 +137,8 @@ impl PartialEq for Node { } } -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] pub enum Decoration { ValidFuncName, InvalidFuncName, -- cgit v1.2.3