grass/src/atrule/mixin.rs

43 lines
855 B
Rust
Raw Normal View History

2020-07-08 14:51:04 -04:00
use crate::{args::FuncArgs, scope::Scopes, Token};
2020-01-12 20:15:40 -05:00
#[derive(Debug, Clone)]
pub(crate) struct Mixin {
2020-06-16 19:38:30 -04:00
pub args: FuncArgs,
2020-06-30 06:53:17 -04:00
pub body: Vec<Token>,
2020-06-16 19:38:30 -04:00
pub accepts_content_block: bool,
2020-07-08 14:51:04 -04:00
pub declared_at_root: bool,
2020-01-12 20:15:40 -05:00
}
impl Mixin {
2020-06-16 19:38:30 -04:00
pub fn new(
args: FuncArgs,
body: Vec<Token>,
accepts_content_block: bool,
2020-07-08 14:51:04 -04:00
declared_at_root: bool,
2020-06-16 19:38:30 -04:00
) -> Self {
Mixin {
args,
body,
accepts_content_block,
2020-07-08 14:51:04 -04:00
declared_at_root,
2020-01-12 20:15:40 -05:00
}
}
}
2020-07-02 10:31:32 -04:00
2020-07-02 15:22:15 -04:00
#[derive(Debug, Clone)]
2020-07-02 10:31:32 -04:00
pub(crate) struct Content {
pub content: Option<Vec<Token>>,
pub content_args: Option<FuncArgs>,
2020-07-08 14:51:04 -04:00
pub scopes: Scopes,
2020-07-02 10:31:32 -04:00
}
impl Content {
2020-07-08 14:51:04 -04:00
pub const fn new() -> Self {
2020-07-02 10:31:32 -04:00
Self {
content: None,
content_args: None,
2020-07-08 14:51:04 -04:00
scopes: Scopes::new(),
2020-07-02 10:31:32 -04:00
}
}
}