diff options
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/align.rs | 2 | ||||
| -rw-r--r-- | src/library/boxed.rs | 2 | ||||
| -rw-r--r-- | src/library/direction.rs | 2 | ||||
| -rw-r--r-- | src/library/mod.rs | 12 |
4 files changed, 12 insertions, 6 deletions
diff --git a/src/library/align.rs b/src/library/align.rs index 03d905cd..6114c3a3 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -28,7 +28,7 @@ function! { } match &self.body { - Some(body) => vec![AddMultiple(layout(&body, ctx)?)], + Some(body) => vec![AddMultiple(layout(&body, ctx).await?)], None => vec![SetAlignment(ctx.alignment)], } } diff --git a/src/library/boxed.rs b/src/library/boxed.rs index a4d059cb..da06a371 100644 --- a/src/library/boxed.rs +++ b/src/library/boxed.rs @@ -46,7 +46,7 @@ function! { ctx.spaces = smallvec![space]; - match layout(&self.body, ctx) { + match layout(&self.body, ctx).await { Ok(layouts) => return Ok(vec![AddMultiple(layouts)]), Err(err) => error = Some(err), } diff --git a/src/library/direction.rs b/src/library/direction.rs index a0992075..39ac2ccd 100644 --- a/src/library/direction.rs +++ b/src/library/direction.rs @@ -36,7 +36,7 @@ function! { } match &self.body { - Some(body) => vec![AddMultiple(layout(&body, ctx)?)], + Some(body) => vec![AddMultiple(layout(&body, ctx).await?)], None => vec![Command::SetAxes(ctx.axes)], } } diff --git a/src/library/mod.rs b/src/library/mod.rs index ac1ac338..513590eb 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -55,19 +55,25 @@ function! { #[derive(Debug, PartialEq)] pub struct FontFamilyFunc { body: Option<SyntaxTree>, - family: String, + list: Vec<String>, } parse(args, body, ctx, meta) { FontFamilyFunc { body: parse!(optional: body, ctx), - family: args.get_pos::<String>()?, + list: { + args.pos().map(|arg| match arg.v { + Expression::Str(s) | + Expression::Ident(Ident(s)) => Ok(s.to_lowercase()), + _ => error!("expected identifier or string"), + }).collect::<LayoutResult<Vec<_>>>()? + } } } layout(self, ctx) { let mut style = ctx.style.text.clone(); - style.fallback.list = vec![self.family.clone()]; + style.fallback.list = self.list.clone(); styled(&self.body, &ctx, style) } } |
