public static UssStyleCondition[] ParseConditions(string src) { src += " "; // padding var p = new UssParser(); p.ParseAll(UssLexer.Parse(src)); return(p.conditions.ToArray()); }
public void ParseAll() { var tokens = UssLexer.Parse("corgi{color:#ABABAB;}"); Assert.AreEqual(UssTokenType.Id, tokens[0].type); Assert.AreEqual(UssTokenType.LeftBracket, tokens[1].type); Assert.AreEqual(UssTokenType.Colon, tokens[3].type); Assert.AreEqual(UssTokenType.HexColor, tokens[4].type); Assert.AreEqual(UssTokenType.SemiColon, tokens[5].type); Assert.AreEqual(UssTokenType.RightBracket, tokens[6].type); }
public static UssParsingResult Parse(string src) { return(new UssParser().ParseAll(UssLexer.Parse(src))); }