@@ -49,7 +49,7 @@ TSimbaScript_Compiler = class(TLapeCompiler)
49
49
procedure Import ; virtual ;
50
50
function Compile : Boolean; override;
51
51
52
- procedure CallProc (ProcName: String; UseFFI: Boolean );
52
+ procedure CallProc (ProcName: String);
53
53
property ImportingSection: String read GetImportingSection write FImportingSection;
54
54
end ;
55
55
@@ -159,7 +159,7 @@ function TSimbaScript_Compiler.Compile: Boolean;
159
159
Result := inherited Compile();
160
160
end ;
161
161
162
- procedure TSimbaScript_Compiler.CallProc (ProcName: String; UseFFI: Boolean );
162
+ procedure TSimbaScript_Compiler.CallProc (ProcName: String);
163
163
var
164
164
Method: TLapeGlobalVar;
165
165
begin
@@ -168,16 +168,12 @@ procedure TSimbaScript_Compiler.CallProc(ProcName: String; UseFFI: Boolean);
168
168
(TLapeType_Method(Method.VarType).Res <> nil ) or (TLapeType_Method(Method.VarType).Params.Count <> 0 ) then
169
169
SimbaException(' CallProc: Invalid procedure "%s"' , [ProcName]);
170
170
171
- if UseFFI then
172
- begin
173
- with LapeExportWrapper(Method) do
174
- try
175
- TProcedure(Func)();
176
- finally
177
- Free();
178
- end ;
179
- end else
180
- RunCode(FEmitter, [], PCodePos(Method.Ptr)^);
171
+ with TLapeCodeRunner.Create(Emitter) do
172
+ try
173
+ Run([], PCodePos(Method.Ptr)^);
174
+ finally
175
+ Free();
176
+ end ;
181
177
end ;
182
178
183
179
function TSimbaScript_Compiler.GetImportingSection : String;
@@ -294,23 +290,23 @@ procedure TSimbaScript_Compiler.InitBaseString;
294
290
295
291
addGlobalFunc(' function CompareStr(s1, s2: string): Int32;' , @_LapeCompareStr);
296
292
addGlobalFunc(' function CompareText(s1, s2: string): Int32;' , @_LapeCompareText);
297
- addGlobalFunc(' function SameText(s1, s2: string): EvalBool ;' , @_LapeSameText);
293
+ addGlobalFunc(' function SameText(s1, s2: string): Boolean ;' , @_LapeSameText);
298
294
299
295
// Uses current user locale
300
296
addGlobalFunc(' function AnsiUpperCase(s: string): string;' , @_LapeAnsiUpperCase);
301
297
addGlobalFunc(' function AnsiLowerCase(s: string): string;' , @_LapeAnsiLowerCase);
302
298
addGlobalFunc(' function AnsiCompareStr(s1, s2: string): Int32;' , @_LapeAnsiCompareStr);
303
299
addGlobalFunc(' function AnsiCompareText(s1, s2: string): Int32;' , @_LapeAnsiCompareText);
304
- addGlobalFunc(' function AnsiSameText(s1,s2: string): EvalBool ;' , @_LapeAnsiSameText);
305
- addGlobalFunc(' function AnsiSameStr(s1,s2: string): EvalBool ;' , @_LapeAnsiSameStr);
300
+ addGlobalFunc(' function AnsiSameText(s1,s2: string): Boolean ;' , @_LapeAnsiSameText);
301
+ addGlobalFunc(' function AnsiSameStr(s1,s2: string): Boolean ;' , @_LapeAnsiSameStr);
306
302
307
303
// Uses current user locale
308
304
addGlobalFunc(' function WideUpperCase(s: WideString): WideString;' , @_LapeWideUpperCase);
309
305
addGlobalFunc(' function WideLowerCase(s: WideString): WideString;' , @_LapeWideLowerCase);
310
306
addGlobalFunc(' function WideCompareStr(s1, s2: WideString): Int32;' , @_LapeWideCompareStr);
311
307
addGlobalFunc(' function WideCompareText(s1, s2: WideString): Int32;' , @_LapeWideCompareText);
312
- addGlobalFunc(' function WideSameText(s1,s2: WideString): EvalBool ;' , @_LapeWideSameText);
313
- addGlobalFunc(' function WideSameStr(s1,s2: WideString): EvalBool ;' , @_LapeWideSameStr);
308
+ addGlobalFunc(' function WideSameText(s1,s2: WideString): Boolean ;' , @_LapeWideSameText);
309
+ addGlobalFunc(' function WideSameStr(s1,s2: WideString): Boolean ;' , @_LapeWideSameStr);
314
310
addGlobalFunc(' function WideFormat(Fmt: WideString; Args: array of Variant): WideString;' , @_LapeWideFormat);
315
311
316
312
addGlobalFunc(' function Pos(Substr, Source: AnsiString): SizeInt; overload;' , @_LapePosA);
@@ -342,10 +338,10 @@ procedure TSimbaScript_Compiler.InitBaseString;
342
338
addGlobalFunc(' function StrToFloat(s: string; Def: Double): Double; overload;' , @_LapeStrToFloatDef);
343
339
addGlobalFunc(' function StrToCurr(s: string): Currency; overload;' , @_LapeStrToCurr);
344
340
addGlobalFunc(' function StrToCurr(s: string; Def: Currency): Currency; overload;' , @_LapeStrToCurrDef);
345
- addGlobalFunc(' function StrToBool(s: string): EvalBool ; overload;' , @_LapeStrToBool);
346
- addGlobalFunc(' function StrToBool(s: string; Default: EvalBool ): EvalBool ; overload;' , @_LapeStrToBoolDef);
341
+ addGlobalFunc(' function StrToBool(s: string): Boolean ; overload;' , @_LapeStrToBool);
342
+ addGlobalFunc(' function StrToBool(s: string; Default: Boolean ): Boolean ; overload;' , @_LapeStrToBoolDef);
347
343
348
- addGlobalFunc(' function BoolToStr(B: EvalBool ; TrueS: string = '' True'' ; FalseS: string = '' False'' ): string;' , @_LapeBoolToStr);
344
+ addGlobalFunc(' function BoolToStr(B: Boolean ; TrueS: string = '' True'' ; FalseS: string = '' False'' ): string;' , @_LapeBoolToStr);
349
345
addGlobalFunc(' function FloatToStr(f: Double): string;' , @_LapeToString_Double);
350
346
addGlobalFunc(' function CurrToStr(Value: Currency): string;' , @_LapeToString_Currency);
351
347
0 commit comments