From 8e42d73c1e1deeaab4ad53fa38d93203f7042480 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 1 Feb 2020 19:33:56 -0500 Subject: [PATCH] Initial implementation of nested styles --- src/lib.rs | 165 +++++++++++++++++++++++++++++++++++++++++++++++++- src/mixin.rs | 1 + src/style.rs | 4 +- tests/main.rs | 40 +++++++----- 4 files changed, 192 insertions(+), 18 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4db5f94..a8b89a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,10 @@ use crate::lexer::Lexer; use crate::mixin::{eat_include, Mixin}; use crate::selector::{Attribute, Selector}; use crate::style::Style; -use crate::utils::{devour_whitespace, eat_variable_value, IsComment, IsWhitespace, VariableDecl}; +use crate::utils::{ + devour_whitespace, eat_variable_value, parse_interpolation, IsComment, IsWhitespace, + VariableDecl, +}; use crate::value::Value; mod args; @@ -198,6 +201,8 @@ pub(crate) struct RuleSet { enum Expr { /// A style: `color: red` Style(Style), + /// Several styles + Styles(Vec