Example #1
0
 public static void AreEqual(NestedValueNode expected, NestedValueNode actual, string message = "")
 {
     Assert.AreEqual(expected.Rules.Count, actual.Rules.Count, message + "/Count");
     for (var i = 0; i < expected.Rules.Count; i++) {
         var expectedValue = expected.Rules[i];
         AreEqual(expectedValue, actual.Rules[i], message + "Rules[" + i + "]");
     }
 }
Example #2
0
 public static NestedValueNode Parse(ScssParserContext context)
 {
     var res = new NestedValueNode();
     context.Tokens.SkipWhiteAndComments();
     context.Tokens.Read(TokenType.OpenCurlyBracket);
     while (!context.Tokens.Empty) {
         context.Tokens.SkipWhiteAndComments();
         var preview = context.Tokens.Peek();
         if (preview.Type == TokenType.CloseCurlyBracket) break;
         if (preview.Type == TokenType.Semicolon) {
             context.Tokens.Read();
             continue;
         }
         var rule = ScssDeclarationNode.Parse(context);
         res.Rules.Add(rule);
     }
     context.Tokens.Read(TokenType.CloseCurlyBracket);
     return res;
 }