public override LessNode VisitMixinCall(LessParser.MixinCallContext context)
        {
            IEnumerable <MixinCallArgument> GetArguments()
            {
                foreach (var arg in context.mixinCallArgument())
                {
                    var namedArg   = arg.variableDeclaration();
                    var expression = GetExpression(arg.expression()) ?? GetValue(namedArg?.expression());

                    if (namedArg != null)
                    {
                        yield return(new NamedArgument(namedArg.variableName().identifier().GetText(), expression));
                    }
                    else
                    {
                        yield return(new PositionalArgument(expression));
                    }
                }
            }

            bool important = context.IMPORTANT() != null;

            var selector = (Selector)context.selector().Accept(this);

            if (context.LPAREN() != null)
            {
                return(new MixinCall(selector, GetArguments(), important));
            }

            return(new RulesetCall(selector, important));
        }
Пример #2
0
 public virtual LessNode VisitMixinCall(LessParser.MixinCallContext context)
 {
     throw new System.NotImplementedException();
 }