public static IList<object> Parse(Reader r, char open, char close) { if (r.Peek == open) { var result = new List<object>(); r.Take(); while (!r.End) { var literal = LiteralParser.Parse(r); if (literal != null) { result.Add(literal); } else { throw new ExpressionParseException(r, "Expected integer."); } r.SkipWhitespace(); if (r.End) { throw new ExpressionParseException(r, "Expected ','."); } else if (r.TakeIf(close)) { return result; } else { if (r.Take() != ',') { throw new ExpressionParseException(r, "Expected ','."); } r.SkipWhitespace(); } } if (!r.End) { r.Take(); return result; } else { throw new ExpressionParseException(r, "Expected ']'."); } } return null; }
private static bool ParseMemberAccessor(Reader r) { return !r.End && r.TakeIf('.'); }
private static bool ParseMemberAccessor(Reader r) { return(!r.End && r.TakeIf('.')); }
private static bool ParseNot(Reader r) { return !r.End && r.TakeIf('!'); }
private static bool ParseNot(Reader r) { return(!r.End && r.TakeIf('!')); }