private object Parse(ParseOperator <string> parseOperator, Type type, Tree <string> parameters)
        {
            TypedValue result = TypedValue.Void;

            Assert.IsTrue(parseOperator.TryParse(processor, type, TypedValue.Void, parameters, ref result));
            return(result.Value);
        }
Example #2
0
        public static bool IsMatch(ParseOperator <Cell> parseOperator, string input)
        {
            var processor = new CellProcessorBase();

            ((CellOperator)parseOperator).Processor = processor;
            return(parseOperator.CanParse(typeof(string), TypedValue.Void, TestUtils.CreateCell(input)));
        }
        static object Parse(ParseOperator <string> parseOperator, Type type, Tree <string> parameters)
        {
            Assert.IsTrue(parseOperator.CanParse(type, TypedValue.Void, parameters));
            TypedValue result = parseOperator.Parse(type, TypedValue.Void, parameters);

            return(result.Value);
        }
        [Test] public void AddedFirstGetsExecutedFirst()
        {
            var operators  = new CellOperators();
            var registered = operators.AddFirst("fitsharp.Test.NUnit.Fit.TestOperator");

            ParseOperator <Cell> executed = null;

            operators.Do <ParseOperator <Cell> >(o => true, o => { executed = o; });

            Assert.AreSame(registered, executed);
        }
Example #5
0
 public static bool IsMatch(ParseOperator<Cell> parseOperator, string input)
 {
     var processor = new CellProcessorBase();
     ((CellOperator) parseOperator).Processor = processor;
     return parseOperator.CanParse(typeof (string), TypedValue.Void, TestUtils.CreateCell(input));
 }
Example #6
0
 private object Parse(ParseOperator<string> parseOperator, Type type, Tree<string> parameters)
 {
     TypedValue result = TypedValue.Void;
     Assert.IsTrue(parseOperator.TryParse(processor, type, TypedValue.Void, parameters, ref result));
     return result.Value;
 }
Example #7
0
 static object Parse(ParseOperator<string> parseOperator, Type type, Tree<string> parameters)
 {
     Assert.IsTrue(parseOperator.CanParse(type, TypedValue.Void, parameters));
     TypedValue result = parseOperator.Parse(type, TypedValue.Void, parameters);
     return result.Value;
 }
Example #8
0
 public override T VisitParseOperator(ParseOperator node)
 {
     throw new NotImplementedException();
 }