예제 #1
0
        private Result Functions(Mnemonic expression, IRuntime runtime)
        {
            var listOfLibs = new LoplaList();

            foreach (var registeredMethod in runtime.GetRegisteredMethods())
            {
                var methodLine = new LoplaList();
                methodLine.Add(new String(registeredMethod.Key));
                foreach (var argument in registeredMethod.Value)
                {
                    methodLine.Add(new String(argument));
                }
                listOfLibs.Add(methodLine);
            }

            return(new Result(listOfLibs));
        }
예제 #2
0
        private Result FunctionInfo(Mnemonic expression, IRuntime runtime)
        {
            var functionName = GetArgument <String>("functionName", runtime);

            var me = runtime
                     .GetRegisteredMethods()
                     .Where(m => m.Key == functionName.Value)
                     .Select(m => m.Value)
                     .FirstOrDefault();

            var functionInformation = new LoplaList();

            if (me != null)
            {
                functionInformation.Add(new String(functionName.Value));
                foreach (var arg in me)
                {
                    functionInformation.Add(new String(arg));
                }
            }

            return(new Result(functionInformation));
        }
예제 #3
0
        private Result Args(Mnemonic expression, IRuntime runtime)
        {
            var ll = new LoplaList();

            if (args != null)
            {
                foreach (var a in args)
                {
                    ll.Add(new String(a));
                }
            }

            return(new Result(ll));
        }