Exemple #1
0
        public void TestSubstringOnANTLRStringStream()
        {
            ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo\r\nThree");

            Assert.AreEqual("Two", stream.Substring(5, 7));
            Assert.AreEqual("One", stream.Substring(0, 2));
            Assert.AreEqual("Three", stream.Substring(10, 14));

            stream.Consume();

            Assert.AreEqual("Two", stream.Substring(5, 7));
            Assert.AreEqual("One", stream.Substring(0, 2));
            Assert.AreEqual("Three", stream.Substring(10, 14));
        }
Exemple #2
0
 public string Substring(int start, int stop)
 {
     return(stream.Substring(start, stop));
 }
		public void TestSubstringOnANTLRStringStream()
		{
			ANTLRStringStream stream = new ANTLRStringStream("One\r\nTwo\r\nThree");

			Assert.AreEqual("Two", stream.Substring(5, 7));
			Assert.AreEqual("One", stream.Substring(0, 2));
			Assert.AreEqual("Three", stream.Substring(10, 14));

			stream.Consume();

			Assert.AreEqual("Two", stream.Substring(5, 7));
			Assert.AreEqual("One", stream.Substring(0, 2));
			Assert.AreEqual("Three", stream.Substring(10, 14));
		}