Code Monkey home page Code Monkey logo

la-pe's People

Watchers

 avatar

la-pe's Issues

todo: OLE

//
// 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

Can't deref certain typed Pointers

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 inside the var block

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

Nested functions can't be recursive

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

  • Merged into: #10

Internal methods don't inherit they're parents variables/types/constants

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

You cannot externally add sets

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

PBoolean, wrong type in Windows unit.

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

Writeln of a pointer to a type with a pointer to its same type gives duplicate declaration

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

Math Function Additions

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

lpexceptions.pas function ReturnAddress for XE2 UP

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

Defines don't work.

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

ToString type method causes WriteLn to fail.

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

Nested IFDEFs produce unexpected, unwanted results.

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

libffi support

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

Simba closes second time I run my script .

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

How does Lape Unions work?

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 create method/class method as global function

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

Call a procedure directly

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

Exit'ing out of a try..finally doesn't work

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

Function list killed by global Var and Const.

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

Calling Conv problem with FPC2.4.4

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

Delphi compatibility

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.