public override void Execute(FunctionCallbackInfo info) { for (int i = 0; i < info.Length; ++i) { info.InterpreterState.IO.Write(string.Join(", ", info[i].Value.Properties)); } }
public override void Execute(FunctionCallbackInfo info) { Console.Write("Input: "); string res = info.InterpreterState.IO.ReadLine(); info.ReturnValue.Value = TypeHelper.ToKObject(res); }
public override void Execute(FunctionCallbackInfo info) { string msg = string.Join("\n", info.InterpreterState.GlobalScope.SymbolList.Where(x => x is FunctionSymbol) .Select(x => "- " + x.Name).ToArray()); info.InterpreterState.IO.Write(msg); }
public override void Execute(FunctionCallbackInfo info) { if (info.Length != 1) { throw new ArgumentException("Expecting one parameter"); } object obj = Cast <object>(info[0]); KType ret = new KType(obj.GetType()); info.ReturnValue.Value = ret; }
public override void Execute(FunctionCallbackInfo info) { if (info.Length != 1) { Error("Bad number of arguments"); } if (!info[0].Value.IsString) { throw new ArgumentException("Argument must be a string"); } try { info.InterpreterState.LoadScript(info[0].Value.Cast <KString>()); } catch (ParserException e) { throw new InterpreterException("Invalid input\n" + e.Message); } }
public override void Execute(FunctionCallbackInfo info) { string msg = ""; if (info.Length > 0) { msg = TypeHelper.ToString(info[0].Value); } if (info.Length > 1) { object[] obj = new object[info.Length - 1]; for (int i = 1; i < info.Length; ++i) { obj[i - 1] = Cast <object>(info[i]); } msg = string.Format(msg, obj); } info.InterpreterState.IO.Write(msg); }
public override void Execute(FunctionCallbackInfo info) { string[] stack = info.InterpreterState.StackTrace; info.InterpreterState.IO.Write(string.Join("\n", stack)); }