Exemplo n.º 1
0
        protected override IEnumerable <LessNode> EvaluateCore(EvaluationContext context)
        {
            bool important = false;

            IEnumerable <Expression> EvaluateExpressions()
            {
                foreach (var expression in Values)
                {
                    foreach (var evaluatedExpression in expression.Evaluate(context).Cast <Expression>())
                    {
                        if (evaluatedExpression is ImportantExpression impExp)
                        {
                            important = true;
                            yield return(impExp.Value);
                        }
                        else
                        {
                            yield return(evaluatedExpression);
                        }
                    }
                }
            }

            // Materializing this enumerable also sets important to true when applicable
            var expressions = EvaluateExpressions().ToList();

            var list = new ExpressionList(expressions, Separator);

            yield return(important ? (LessNode) new ImportantExpression(list) : list);
        }
Exemplo n.º 2
0
 public MediaIdentifierQuery(MediaQueryModifier modifier, ExpressionList identifier, bool parens) : base(modifier)
 {
     this.identifier = identifier;
     this.parens     = parens;
 }
Exemplo n.º 3
0
 protected bool Equals(ExpressionList other)
 {
     return(Values.SequenceEqual(other.Values));
 }