Esempio n. 1
0
        public void WriteArray(PropertyArray array)
        {
            AppendLine("{0}", "(");
            Indent();

            for (int i = 0; i < array.Count; i++)
            {
                WriteObject(array[i]);
                if (i != array.Count - 1) AppendLine(", ");
            }

            Dedent();
            Append("{0}", ")");
        }
Esempio n. 2
0
        private static object ParseArray(Lexer lexer)
        {
            PropertyArray array = new PropertyArray();

            while (true)
            {
                Token token = lexer.Next();

                if (token.Kind == TokenKind.ArrayClose) break;

                object value = ParseObject(lexer, token);

                array.AppendValue(value);

                Token terminator = lexer.Next();

                if (terminator.Kind == TokenKind.ArrayClose) break;
                if (terminator.Kind == TokenKind.Separator) continue;

                ThrowBecauseOfAnUnexpectedToken(lexer, terminator);
            }

            return array;
        }
Esempio n. 3
0
 public void AppendValues(PropertyArray values)
 {
     foreach(object value in values)
     {
         _list.Add(value);
     }
 }
Esempio n. 4
0
        void AssertArraysEqual(PropertyArray left, PropertyArray right)
        {
            Assert.AreEqual(left.Count, right.Count);

            for (int i = 0; i < left.Count; i++)
            {
                AssertPropertyValuesAreEqual(left[i], right[i]);
            }
        }