From f549914ff8d66e48e779d4d99898a224bd1ab701 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 12 Dec 2019 23:33:26 +0100 Subject: =?UTF-8?q?Refine=20and=20rename=20layouting=20types=20?= =?UTF-8?q?=F0=9F=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/func/mod.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/func') diff --git a/src/func/mod.rs b/src/func/mod.rs index c8cf23c6..a5328314 100644 --- a/src/func/mod.rs +++ b/src/func/mod.rs @@ -12,13 +12,7 @@ mod macros; /// Useful imports for creating your own functions. pub mod prelude { pub use crate::func::{Scope, ParseFunc, LayoutFunc, Command, Commands}; - pub use crate::layout::{ - layout_tree, Layout, MultiLayout, - LayoutContext, LayoutSpace, LayoutSpaces, LayoutExpansion, - LayoutAxes, Axis, GenericAxisKind, SpecificAxisKind, - LayoutAlignment, Alignment, - SpacingKind, LayoutResult, - }; + pub use crate::layout::prelude::*; pub use crate::syntax::{ parse, ParseContext, ParseResult, SyntaxTree, FuncCall, FuncArgs, PosArg, KeyArg, @@ -107,7 +101,7 @@ pub enum Command<'a> { Add(Layout), AddMultiple(MultiLayout), - AddSpacing(Size, SpacingKind, GenericAxisKind), + AddSpacing(Size, SpacingKind, GenericAxis), FinishLine, FinishRun, @@ -149,13 +143,13 @@ impl Scope { /// Associate the given name with a type that is parseable into a function. pub fn add(&mut self, name: &str) where F: ParseFunc + LayoutFunc + 'static { - self.add_with_metadata::(name, ()); + self.add_with_metadata::(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: T) - where F: ParseFunc + LayoutFunc + 'static, T: 'static + Clone { + pub fn add_with_metadata(&mut self, name: &str, metadata: ::Meta) + where F: ParseFunc + LayoutFunc + 'static { self.parsers.insert( name.to_owned(), Box::new(move |a, b, c| { -- cgit v1.2.3