コード例 #1
0
 public void CanParseSingleDigitIntegers()
 {
     for (int i = 0; i < 9; i++)
     {
         var tokens = new PlusMinusTokenizer().Scan(i.ToString(CultureInfo.InvariantCulture)).ToList();
         Assert.AreEqual(i, (tokens.First() as NumberConstantToken).Value);
     }
 }
コード例 #2
0
        public int CanParseNumbersNumbersWithMoreDigits(string expression)
        {
            var tokens = new PlusMinusTokenizer().Scan(expression).ToList();

            return((tokens.First() as NumberConstantToken).Value);
        }
コード例 #3
0
        public Type CanParseOperatorTokens(string expression)
        {
            var tokens = new PlusMinusTokenizer().Scan(expression);

            return(tokens.First().GetType());
        }