public override RunTimeValueBase execute(RunTimeValueBase thisObj,SLOT[] argements,object stackframe,out string errormessage,out int errorno) { errormessage = null; errorno = 0; LinkObj <long> i64 = ((LinkObj <long>)((ASBinCode.rtData.rtObjectBase)thisObj).value); return(new ASBinCode.rtData.rtNumber(i64.value)); }
public override void execute3(RunTimeValueBase thisObj, FunctionDefine functionDefine, SLOT returnSlot, SourceToken token, StackFrame stackframe, out bool success) { LinkObj<UInt64> obj = ((LinkObj<UInt64>)((ASBinCode.rtData.rtObjectBase)thisObj).value); returnSlot.setValue((double)obj.value); success = true; }
//public override RunTimeValueBase execute(RunTimeValueBase thisObj, SLOT[] argements, object stackframe, out string errormessage, out int errorno) //{ // errormessage = null; errorno = 0; // LinkObj<long> i64 = ((LinkObj<long>)((ASBinCode.rtData.rtObjectBase)thisObj).value); // return new ASBinCode.rtData.rtNumber(i64.value); //} public override void execute3(RunTimeValueBase thisObj,FunctionDefine functionDefine,SLOT returnSlot,SourceToken token,StackFrame stackframe,out bool success) { success = true; LinkObj <long> i64 = ((LinkObj <long>)((ASBinCode.rtData.rtObjectBase)thisObj).value); returnSlot.setValue((double)i64.value); //return new ASBinCode.rtData.rtNumber(i64.value); }
public override void execute3(RunTimeValueBase thisObj,FunctionDefine functionDefine,SLOT returnSlot,SourceToken token,StackFrame stackframe,out bool success) { string format = TypeConverter.ConvertToString(argements[0],stackframe,token); LinkObj <byte> obj = ((LinkObj <byte>)((ASBinCode.rtData.rtObjectBase)thisObj).value); returnSlot.setValue(obj.value.ToString(format)); success = true; }
public RunTimeValueBase makeObject(Class cls) { if (cls.isStruct) { LinkObj <T> obj = new LinkObj <T>(cls); return(new ASBinCode.rtData.rtObject(obj,null)); } else { LinkObj <object> obj = new LinkObj <object>(cls); return(new ASBinCode.rtData.rtObject(obj,null)); } }
//public override NativeFunctionMode mode //{ // get // { // return NativeFunctionMode.normal_1; // } //} //public override RunTimeValueBase execute(RunTimeValueBase thisObj, SLOT[] argements, object stackframe, out string errormessage, out int errorno) //{ // throw new NotImplementedException(); //} //public override void execute2(RunTimeValueBase thisObj, // FunctionDefine functionDefine, // SLOT[] argements, // SLOT returnSlot, // SourceToken token, // object stackframe, out bool success) //{ // LinkObj<T> lobj = (LinkObj<T>)((ASBinCode.rtData.rtObject)thisObj).value; // StackFrame frame = (StackFrame)stackframe; // var arg = argements[0].getValue(); // if (arg.rtType == RunTimeDataType.rt_null) // { // ((StackSlot)returnSlot).setValue(lobj.value.CompareTo(default(T))); // } // else // { // LinkObj<T> argObj = (LinkObj<T>)((ASBinCode.rtData.rtObject)arg).value; // ((StackSlot)returnSlot).setValue(lobj.value.CompareTo(argObj.value)); // } // success = true; //} public override void execute3(RunTimeValueBase thisObj,FunctionDefine functionDefine,SLOT returnSlot,SourceToken token,StackFrame stackframe,out bool success) { LinkObj <T> lobj = (LinkObj <T>)((ASBinCode.rtData.rtObjectBase)thisObj).value; StackFrame frame = stackframe; var arg = argements[0]; if (arg.rtType == RunTimeDataType.rt_null) { (returnSlot).setValue(lobj.value.CompareTo(default(T))); } else { LinkObj <T> argObj = (LinkObj <T>)((ASBinCode.rtData.rtObjectBase)arg).value; (returnSlot).setValue(lobj.value.CompareTo(argObj.value)); } success = true; }
public override RunTimeValueBase execute(RunTimeValueBase thisObj,SLOT[] argements,object stackframe,out string errormessage,out int errorno) { errormessage = null; errorno = 0; var cls = (Class)stackframe; if (cls.isStruct) { LinkObj <T> obj = new LinkObj <T>((Class)stackframe); return(new ASBinCode.rtData.rtObject(obj,null)); } else { LinkObj <object> obj = new LinkObj <object>((Class)stackframe); return(new ASBinCode.rtData.rtObject(obj,null)); } }
/// <summary> /// Compile Link /// </summary> protected virtual string OutputLink(IList<string> cap, LinkObj link) { var href = StringHelper.Escape(link.Href); var title = !string.IsNullOrEmpty(link.Title) ? StringHelper.Escape(link.Title) : null; return cap[0][0] != '!' ? _options.Renderer.Link(href, title, Output(cap[1])) : _options.Renderer.Image(href, title, StringHelper.Escape(cap[1])); }