コード例 #1
0
        public void NegateFailParse()
        {
            IScanner        scanner = Provider.Scanner;
            NegatableParser parser  = -Prims.CharOf(MatchedChar);

            ParserMatch m = parser.Parse(scanner);

            Assert.IsTrue(!m.Success);
            Assert.AreEqual(scanner.Offset, 0);
        }
コード例 #2
0
        public void FailParse()
        {
            IScanner   scanner = Provider.Scanner;
            CharParser parser  = Prims.CharOf(NonMatchedChar);

            ParserMatch m = parser.Parse(scanner);

            Assert.IsTrue(!m.Success);
            Assert.AreEqual(scanner.Offset, 0);
        }
コード例 #3
0
        public void NegateSuccessParse()
        {
            IScanner        scanner = Provider.Scanner;
            NegatableParser parser  = -Prims.CharOf(NonMatchedChar);

            ParserMatch m = parser.Parse(scanner);

            Assert.IsTrue(m.Success);
            Assert.AreEqual(m.Offset, 0);
            Assert.AreEqual(m.Length, 1);
            Assert.AreEqual(scanner.Offset, 1);
        }