ncds / la-pe Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/la-pe
Automatically exported from code.google.com/p/la-pe
//
// file: main.pas
//
uses
{+}
{$IFDEF MSWINDOWS}Windows,{$ENDIF}
{+.}
...
,StrUtils
{$IFDEF COM}
,ComObj {$IFDEF FPC},Ole2{$ENDIF}, ActiveX
{$ENDIF COM}
;
...
{$IFDEF COM}
function CreateOLEObject(const ClassName: string): Variant;
begin
Result := CreateOLEObject(ClassName);
end;
{$ENDIF COM}
...
procedure TForm1.FormCreate(Sender: TObject);
begin
CoInitializeEx(nil, 0);
end;
...
procedure Compile(Run, Disassemble: Boolean);
...
Compiler.addGlobalFunc('function CreateOLEObject(const ClassName: string): Variant;', @CreateOLEObject);
//
// file: test\ole.lap
//
var
s: string;
xmlDoc: Variant;
begin
s := 'MSXML2.DOMDocument';
WriteLn('com(1):', s);
xmlDoc := VarCreateOLEObject('MSXML2.DOMDocument');
xmlDoc.validateOnParse := True; // *** LINE 8 ***
xmlDoc.async := False;
xmlDoc := Null;
WriteLn('com(1)!', s);
end;
//
// error:
//
Compilation error: "Operator "Dot" not compatible with types "Variant" and
"AnsiString" at line 8, column 9"
Original issue reported on code.google.com by [email protected]
on 19 Sep 2011 at 6:59
See patch for initial .rst lape tutorial.
If you don't want it hosted in the repo, let me know. Just looking for a place
to host it right now.
You can build a basic version with rst2html, but that command doesn't support
code-block's. I'll work on a simple command to build a .html and .pdf later.
Original issue reported on code.google.com by [email protected]
on 2 Nov 2011 at 1:18
Attachments:
What will reproduce the problem?
http://paste.villavu.com/show/x7iV1TALSkH1wzLwtYL1/
What is the expected output? What do you see instead?
42, Exception
Which version are you using?
r105
Please provide any additional information below.
Only on Pointers of Records.
Original issue reported on code.google.com by [email protected]
on 25 Jun 2011 at 11:35
Initializing a method pointer inside of the variable block doesn't work when
the value is a script method.
Access Violation
http://pastebin.com/1i7kmzmn
Original issue reported on code.google.com by [email protected]
on 4 Feb 2013 at 1:32
A function (or procedure) declared inside a function cannot be recursive or
call any other nested functions.
Test code here:
procedure Test;
procedure Woof;
begin
Woof;
end;
procedure Meow;
begin
Woof;
end;
begin
end;
begin
end.
Commenting out the recursive Woof call then gives the unknown declaration error
on Meow's call of Woof.
Not sure if this is a bug, a bug/feature, or unsupported functionality, so
hopefully I'm not being silly.
Original issue reported on code.google.com by [email protected]
on 23 Mar 2012 at 9:03
What will reproduce the problem?
http://pastebin.com/q3sePpqB
What is the expected output? What do you see instead?
Should print "42" (It works in Laz)
I get "Exception in Script: Unknown declaration "c" at line 8, column 15"
Which version are you using?
http://nala.villavu.com/downloads/settings-form/a1e88941403676e79607acc0ee1d54630e90d1e9/
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 28 Jan 2012 at 1:41
What will reproduce the problem?
Using addGlobalType to add a set like
addGlobalType('(test1, test2)', 'TTest');
What is the expected output? What do you see instead?
It should add the set, I get a exception on running a blank script.
Which version are you using?
Revision 49
Please provide any additional information below.
I can create types like that internally.
type
TTest = (test1, test2);
This Works.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2011 at 9:24
What will reproduce the problem?
Don't define LCL, and try to compile.
What is the expected output? What do you see instead?
It should compile, Errors.
Which version are you using?
FPC 2.6.0
Lape 5784e9fe0725fa8aff2b6144b7c76e59e3002c58
Please provide any additional information below.
The Windows unit defines PBoolean as ^Byte for compatibility with Delphi.
Add a redefinition of PBoolean as ^Boolean after the Windows unit is loaded.
Original issue reported on code.google.com by [email protected]
on 2 Jan 2012 at 5:57
If you create a custom type with a field which is a pointer to the same type,
trying to Writeln a pointer to your type will produce a Duplicate declaration
error, but only if you haven't already printed your type using Writeln.
Example code:
type
PMyType = ^MyType;
MyType = record
toast: PMyType;
end;
var
myVar: PMyType;
begin
New(myVar);
//Writeln(myVar^); // Doesn't throw error if uncommented
Writeln(myVar); // Throws error
end.
Uncommenting the line and leaving the second Writeln in results in the script
running to completion without a problem.
Original issue reported on code.google.com by [email protected]
on 14 Mar 2012 at 8:58
Can we get the Functions from Math.simba in SRL5 added to LAPE Pretty please.
BTW have I told you I <3 Lape Lately. We started work on SRL6. :D
Original issue reported on code.google.com by [email protected]
on 11 Oct 2012 at 12:49
XE2 UP has a built-in implementation function (ReturnAddress). You can now
write the cross-platform for "lpexceptions.pas":
implementation
{$IFDEF Delphi}
{$IF CompilerVersion < 21.00}
function ReturnAddress: Pointer;
asm
MOV EAX, [EBP+4]
end;
{$IFEND}
{$ENDIF}
procedure _LapeException(Msg: lpString); inline;
{$IFDEF FPC}
begin
...
end;
{$ELSE}
begin
raise lpException.Create(Msg) at ReturnAddress;
end;
{$ENDIF}
...
Original issue reported on code.google.com by [email protected]
on 8 Dec 2012 at 2:49
What will reproduce the problem?
{$IFDEF WTF}WriteLn('Hmmm');{$ENDIF}
What is the expected output? What do you see instead?
Nothing, Hmmm
Which version are you using?
r105
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 25 Jun 2011 at 10:35
What will reproduce the problem?
http://paste.villavu.com/show/AWaEmivhUS0gfu7WcwLm/
What is the expected output?
nil
[]
What do you see instead?
Access violation
Which version are you using?
e2c7fdaf2bd7
Please provide any additional information below.
Using Simba build 150.
Original issue reported on code.google.com by [email protected]
on 3 Jun 2013 at 12:14
What will reproduce the problem?
program new;
{$DEFINE BAR}
{$IFDEF FOO}
{$IFDEF BAR}
var gsb: integer;
{$ELSE}
var gsgss: integer;
{$ENDIF}
{$ENDIF}
begin
// this should not be possible. neither should exist!
gsgss := 42;
end.
What is the expected output? What do you see instead?
See above.
Which version are you using?
Latest in Simba.
Original issue reported on code.google.com by [email protected]
on 27 Jul 2012 at 11:55
how to update existed repository?
Original issue reported on code.google.com by [email protected]
on 1 Aug 2012 at 6:10
I've been working on a FPC libffi unit, and some of the basic cases seem to
work just fine. (See below)
My question is, how exactly do you want this integrated in lape?
Do you want to generate CIF's automatically when someone uses a specific
keyword? The same goes for function wrappers, do you want to generate those
automatically for lape functions? (You can even make a
call-this-function-with-any-arguments-wrap-all function with libffi, or so I
have read)
----------------------------------------
var
Cif: TFFICif;
s: TFFIStatus;
ret: ptruint;
int_type: TFFIType;
begin
writeln(fpgetpid());
s := ffi_prep_cif(@cif, FFI_DEFAULT_ABI, 0, @ffi_type_uint64, nil);
writeln('S:' + inttostr(PtrUInt(s)));
if s = FFI_OK then
begin
writeln('Woo');
ffi_call(@cif, @fpgetpid, @ret, nil);
writeln('Result: ' + inttostr(ret));
end;
end;
Results in:
$ ./project1
5853
S:0
Woo
Result: 5853
Original issue reported on code.google.com by [email protected]
on 26 Apr 2012 at 3:08
http://pastebin.com/Uz65K0yR
First I is 0, Second I is 42.
It should be 0 and 0, then X would be 42.
Original issue reported on code.google.com by [email protected]
on 31 Jan 2013 at 3:23
What will reproduce the problem?
running the following script:
http://paste.villavu.com/show/3667/
line 33 will cause the error. The first time I run it will cause no errors and
the expected outcome. The second time will close simba.
What is the expected output? What do you see instead?
Simba closes. Lazarus directs me to: lpeval -> line 475
procedure _LapeToString_Extended(const Params: PParamArray; const Result:
Pointer); {$IFDEF Lape_CDECL}cdecl;{$ENDIF}
begin
PlpString(Result)^ := FloatToStr(PExtended(Params^[0])^);
end;
Which version are you using?
Pulled the latest with git.
Gr,
Bart de Boer,
masterBB
Original issue reported on code.google.com by [email protected]
on 5 Dec 2012 at 2:06
I can't find out how Unions work for anything.
Would also like to know if External should be working yet?
I see you have it as a keyword, tho it doesn't work for me.
Would also like to see inline added. =)
Original issue reported on code.google.com by [email protected]
on 8 Jun 2011 at 6:06
todo: how to crete method/class method as global function (without usage global
pameters)
class procedure TForm1.MyWrite1(S: string);
begin
System.Write(...
end;
procedure TForm1.MyWrite2(S: string);
begin
Memo.Lines.Add(...
end;
????:
Compiler.addGlobalFuncFromClass('function VarCreateOLEObject(const ClassName:
string): Variant;', @TForm1.MyWrite1, TForm1);
Compiler.addGlobalFuncFromObject('function VarCreateOLEObject(const ClassName:
string): Variant;', @TForm1.MyWrite2);
Original issue reported on code.google.com by [email protected]
on 19 Sep 2011 at 7:11
This post is more a newbie question than a bug report...
Thanks for your great job, looks very promising.
I have a question : how to call a procedure with parameters directly?
RunCode(Compiler.Emitter.Code);
runs all the script but I need to call only one declared procedure.
Any solution?
Please provide any additional information below.
Thanks
Original issue reported on code.google.com by [email protected]
on 15 Jun 2013 at 8:53
What will reproduce the problem?
http://paste.villavu.com/show/543/
What is the expected output? What do you see instead?
Before Try
After Try
In Finally (You don't get this.)
Which version are you using?
r72
Original issue reported on code.google.com by [email protected]
on 31 Mar 2011 at 12:32
https://github.com/SRL/SRL-6/commit/dc82f7ef0305b6862d37a78e643585db42545d5e#L2R
42
For actual code on the error.
<BraK> Just so you can see the code where the error accuors
<Wizzup> oh, a bug
<BraK> Lape allows us to declare Const and Var globally that way but it kills
the function list.
<BraK> So I figured it was an issue in Simba.
<Wizzup> BraK, if pascalscript or another parser is used to parse the script
(which it is), then it may not support all lape syntax and break
<Wizzup> best bug niels about this
Original issue reported on code.google.com by [email protected]
on 11 Oct 2012 at 3:08
Will allow people to use IntToHex with only one parameter.
I tested and seems to work fine.
Original issue reported on code.google.com by [email protected]
on 3 Aug 2012 at 1:00
Attachments:
What will reproduce the problem?
Compiling Lape on Linux with FPC 2.4.4
What is the expected output? What do you see instead?
Compiled Sucessfully. Error.
Which version are you using?
N/A, FPC 2.4.4
Please provide any additional information below.
Your changes in
186015e8e9cd46073f69edf2ff3c74f86004710d and fd8825655b10340c37619e2d945c5d27d6343589
broke compatibility with FPC 2.4.4. In 2.4.4 even on linux it should be stdcall.
Here's an example of what it should be like: http://paste.villavu.com/show/9QAEdGLcjQgRfHu58ntt/
Original issue reported on code.google.com by [email protected]
on 28 Mar 2012 at 8:59
Does LaPe support Delphi as advertized?
I'm getting numerous warnings when compiling under Delphi XE, and compiling
simple scripts (f.i. just "program test; const c = 1; end;" results in stack
corruption of the host application.
Original issue reported on code.google.com by [email protected]
on 29 Mar 2013 at 6:59
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.