diff --git a/Source/RuntimeBuilder.Fasm.pas b/Source/RuntimeBuilder.Fasm.pas index 814b6ac..0b2be1e 100644 --- a/Source/RuntimeBuilder.Fasm.pas +++ b/Source/RuntimeBuilder.Fasm.pas @@ -14,9 +14,9 @@ type TRTBFasmSource=class(TRTBSource) protected type TRTBFasmModule=class(TRTBModule) - private type + protected type TRTBFasmFunc=class(TRTBFunc) - private + protected p:Pointer; public constructor Create(p:Pointer); @@ -33,7 +33,7 @@ type constructor Create(p:pointer;&Type:TRTBType); destructor Destroy;override; end; - private + protected p:Pointer; sb:NativeUInt; funcs:TDictionary; @@ -341,8 +341,6 @@ else end; procedure TRTBFasmCompiler.TRTBFasmSource.UnRegisterFunction(NameSpace:string;Name:string); -var - i:NativeUInt; begin if NameSpace<>'' then Name:=NameSpace+'.'+Name; @@ -535,7 +533,7 @@ function TRTBFasmCompiler.TRTBFasmSource.Compilate:TRTBModule; PreDecl:=PreDecl+Key+' equ 0'+sLineBreak; end; var - templib,pointerDecl,PreDecl:string; + pointerDecl,PreDecl:string; Res:TFasmResult; i,base,sb:NativeUInt; FuncDict:TDictionary; diff --git a/Source/RuntimeBuilder.Lua.pas b/Source/RuntimeBuilder.Lua.pas index 5f260dd..9122d86 100644 --- a/Source/RuntimeBuilder.Lua.pas +++ b/Source/RuntimeBuilder.Lua.pas @@ -12,12 +12,12 @@ type TRTBLuaSource=class(TRTBSource) protected type TRTBLuaModule=class(TRTBModule) - private type + protected type TRTBLuaFunc=class(TRTBFunc) - private + protected //p:Pointer; public - constructor Create(s:string); + //constructor Create(s:string); //function Call(OutType:PTypeInfo;args:TArray;CallType:TRTBCallType=CRTBCallTypeDefault):TValue;override; //destructor Destroy;override; end; @@ -66,6 +66,9 @@ type //procedure AddConst(NameSpace:string;Name:string;Val:TValue);override; //procedure DelConst(NameSpace:string;Name:string);override; + //procedure AddCallBack(NameSpace:string;Name:string;CallBack:TRTBCallBack);override; + //procedure DelCallBack(NameSpace:string;Name:string);override; + //procedure AddVariable(NameSpace:string;Name:string;var Data);override; //procedure ExportVariable(NameSpace:string;Name:string;var Data);override; //procedure DelVariable(NameSpace:string;Name:string);override; @@ -615,7 +618,7 @@ with consts do with Items[i] do ConstParse(Key,Value,PreDecl,base);} -Result:=TRTBLuaModule.Create(FText,funcs); +//Result:=TRTBLuaModule.Create(FText,funcs); end; destructor TRTBLuaCompiler.TRTBLuaSource.Destroy; diff --git a/Tests/Project2.dproj b/Tests/Project2.dproj index 5880646..d516b65 100644 --- a/Tests/Project2.dproj +++ b/Tests/Project2.dproj @@ -485,13 +485,13 @@ begin 1 - + + - False diff --git a/Tests/Unit1.pas b/Tests/Unit1.pas index d07cf4f..8c41dd5 100644 --- a/Tests/Unit1.pas +++ b/Tests/Unit1.pas @@ -27,11 +27,21 @@ var begin Fasm:=TRTBFasmCompiler.Create('..\..\..\lib\FasmOnDelphi\fasmw172\fasm'); Src:=Fasm.GenNewSrc; -Src.Text:='use32'+sLineBreak+'main:'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx'+sLineBreak+'Pmain dd 0'+ - sLineBreak+'varmain:'+sLineBreak+'mov eax,[Pmain]'+sLineBreak+'ret'; -Src.RegisterFunction('','main'); -Src.RegisterFunction('','varmain'); -Src.Register('','Pmain',TypeInfo(integer)); +with Src do +begin + Text:='use32'+sLineBreak+ + 'main:'+sLineBreak+ + 'pop ecx'+sLineBreak+ + 'pop eax'+sLineBreak+ + 'jmp ecx'+sLineBreak+ + 'Pmain dd 0'+sLineBreak+ + 'varmain:'+sLineBreak+ + 'mov eax,[Pmain]'+sLineBreak+ + 'ret'; + RegisterFunction('','main'); + RegisterFunction('','varmain'); + Register('','Pmain',TypeInfo(integer)); +end; Module:=Src.Compilate; Func1:=Module.Funtion['main']; Func2:=Module.Funtion['varmain']; diff --git a/Tests/Win64/Debug/dunitx-results.xml b/Tests/Win64/Debug/dunitx-results.xml new file mode 100644 index 0000000..b4630e2 --- /dev/null +++ b/Tests/Win64/Debug/dunitx-results.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/FasmOnDelphi b/lib/FasmOnDelphi index acb5bd9..11ee2b8 160000 --- a/lib/FasmOnDelphi +++ b/lib/FasmOnDelphi @@ -1 +1 @@ -Subproject commit acb5bd9c9b6f2bebf0d7e134e2978118a1a88b3c +Subproject commit 11ee2b898509dc851eb96bc2bad3909ee32d6bc6