changed hcl_geterrnum() to HCL_ERRNUM().
All checks were successful
continuous-integration/drone/push Build is passing

reintroduced hcl_geterrnum() as a function
This commit is contained in:
2024-02-03 13:36:05 +09:00
parent d339338a40
commit 9aa1bde1a1
15 changed files with 125 additions and 113 deletions

View File

@ -4,55 +4,6 @@ program main;
uses HCL, sysutils;
(*
function Make(): HCL.InterpPtr;
var
x: HCL.Interp;
begin
x := HCL.Interp.Create(20);
Make := @x;
end;
function Make2(): HCL.Interp;
begin
Make2 := HCL.Interp.Create(20);
end;
var
x: HCL.Interp;
x2: ^HCL.Interp;
begin
Write ('sizeof X=>');
Writeln (SizeOf(x));
x := HCL.Interp.Make(20);
Write ('instance sizeof X=>');
Writeln (x.InstanceSize());
// x.Open();
// x.Close();
x.Destroy();
//x.Free();
Write ('sizeof X2=>');
Writeln (SizeOf(x2));
// New(x2);
// x2^.Open();
// //x2^.Destroy();
// //x2^.Free();
// Dispose (x2);
x := Make2();
//Writeln (x.handle);
x.Destroy();
x := nil;
// x2 := Make();
// Writeln (x2^.handle);
// x2^.Destroy();
end.
*)
var
x: HCL.Interp = nil;
begin
@ -65,11 +16,11 @@ begin
//x.AttachUDIO();
x.Compile(pwidechar('(printf "hello 동키콩\n")'));
x.Compile('(printf "hello 동키콩월드\n")');
x.Compile('(a := 20)');
x.Compile('(printf "%d\n" a)');
x.Compile('(printf "hello 동키콩월드\n") ');
x.Compile('(동가리오 := 20)');
x.Compile('(printf "%d %d\n" 동가리오 (* 동가리오 동가리오))');
x.Execute();
x.Execute(); // check if exception...
except
on e: Exception do
writeln ('exception:', e.Message);