Пример #1
0
 public static ScssDeclarationNode Parse(ScssParserContext context)
 {
     var res = new ScssDeclarationNode();
     context.Tokens.SkipWhiteAndComments();
     res.Property = context.Tokens.Read(TokenType.Literal).StringValue;
     context.Tokens.SkipWhiteAndComments();
     context.Tokens.Read(TokenType.Colon);
     context.Tokens.SkipWhiteAndComments();
     var preview = context.Tokens.Peek();
     if (preview.Type == TokenType.OpenCurlyBracket) {
         res.Value = NestedValueNode.Parse(context);
     } else {
         res.Value = ValuesNode.Parse(context);
     }
     return res;
 }
Пример #2
0
 public static void AreEqual(ScssDeclarationNode expected, ScssDeclarationNode actual, string message = "")
 {
     Assert.AreEqual(expected.Property, actual.Property, message + "/Property");
     AreEqual(expected.Value, actual.Value, message + "/Value");
 }