コード例 #1
0
        public void Executor_NestedFunctions_One_Success()
        {
            var tree = new ParseTree();
            var addNode = new FunctionNode("add");
            addNode.AddChild(GetRandNode());
            addNode.AddChild(new ValueNode("3", Token.Int));
            tree.Root.AddChild(addNode);

            var result = _executor.Execute(tree);

            Assert.IsTrue(result.Success, "Should be able to process nested functions");
        }
コード例 #2
0
        private FunctionNode GetRandNode()
        {
            var funcNode = new FunctionNode("rand");
            funcNode.AddChild(new ValueNode("5", Token.Int));

            return funcNode;
        }