From 03fddaf3aea778057aedd74dbcb27bae971ec22f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Fri, 24 Jan 2020 12:44:04 +0100 Subject: =?UTF-8?q?Non-fatal=20argument=20parsing=20=F0=9F=8C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/func/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/func/mod.rs') diff --git a/src/func/mod.rs b/src/func/mod.rs index e3399903..b3721d91 100644 --- a/src/func/mod.rs +++ b/src/func/mod.rs @@ -26,7 +26,7 @@ pub trait Parse { /// Parse the header and body into this function given a context. fn parse( header: FuncHeader, - body: Option<(Position, &str)>, + body: Option>, ctx: ParseContext, metadata: Self::Meta, ) -> Parsed where Self: Sized; @@ -36,7 +36,7 @@ pub trait Parse { /// implements [`Model`]. type Parser = dyn Fn( FuncHeader, - Option<(Position, &str)>, + Option>, ParseContext, ) -> Parsed>; @@ -50,7 +50,7 @@ pub enum Command<'a> { Add(Layout), AddMultiple(MultiLayout), - SpacingFunc(Size, SpacingKind, GenericAxis), + AddSpacing(Size, SpacingKind, GenericAxis), FinishLine, FinishSpace, @@ -88,12 +88,12 @@ impl Scope { /// Associate the given name with a type that is parseable into a function. pub fn add(&mut self, name: &str) where F: Parse + Model + 'static { - self.add_with_metadata::(name, ()); + self.add_with_meta::(name, ()); } /// Add a parseable type with additional metadata that is given to the /// parser (other than the default of `()`). - pub fn add_with_metadata(&mut self, name: &str, metadata: ::Meta) + pub fn add_with_meta(&mut self, name: &str, metadata: ::Meta) where F: Parse + Model + 'static { self.parsers.insert( name.to_owned(), -- cgit v1.2.3