Beispiel #1
0
        protected override Value Clone()
        {
            AtRuleUnit result = new AtRuleUnit();

            result.AtRule = AtRule;
            return(result);
        }
Beispiel #2
0
        public override Value ReadStartValue(CssLexer lexer)
        {
            // Read off the at:
            lexer.Read();

            // Read the name now:
            string name = lexer.ReadString();

            // Skip any junk:
            lexer.SkipJunk();

            // Map to an at rule:
            CssAtRule rule = CssAtRules.GetLocal(name);

            if (rule == null)
            {
                // Unrecognised - enter error recovery mode:
                lexer.ErrorRecovery();

                // Done:
                return(null);
            }

            // Create the representitive unit:
            AtRuleUnit at = new AtRuleUnit();

            at.AtRule = rule;

            // Now in @ mode:
            rule.SetupParsing(lexer);

            return(at);
        }