mixin stores body as Vec<Token>

This commit is contained in:
Connor Skees 2020-06-30 06:53:17 -04:00
parent f476f4af25
commit 6ea036581b
2 changed files with 4 additions and 7 deletions

View File

@ -1,14 +1,10 @@
use std::vec::IntoIter;
use peekmore::{PeekMore, PeekMoreIterator};
use crate::{args::FuncArgs, scope::Scope, Token};
#[derive(Debug, Clone)]
pub(crate) struct Mixin {
pub scope: Scope,
pub args: FuncArgs,
pub body: PeekMoreIterator<IntoIter<Token>>,
pub body: Vec<Token>,
pub accepts_content_block: bool,
}
@ -19,7 +15,6 @@ impl Mixin {
body: Vec<Token>,
accepts_content_block: bool,
) -> Self {
let body = body.into_iter().peekmore();
Mixin {
scope,
args,

View File

@ -2,6 +2,8 @@ use std::mem;
use codemap::Spanned;
use peekmore::PeekMore;
use crate::{
args::{CallArgs, FuncArgs},
atrule::Mixin,
@ -97,7 +99,7 @@ impl<'a> Parser<'a> {
self.eval_mixin_args(&mut mixin, args)?;
let body = Parser {
toks: &mut mixin.body,
toks: &mut mixin.body.into_iter().peekmore(),
map: self.map,
path: self.path,
scopes: &mut NeverEmptyVec::new(mixin.scope),