Type Library Editor, FPC 3.1.1+ support.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5947 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2017-06-19 17:28:02 +00:00
parent aa308d6bd2
commit 8c8c9480dd
3 changed files with 16 additions and 9 deletions

View File

@ -10,15 +10,14 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
} }
{$INCLUDE wst_global.inc}
unit edit_helper; unit edit_helper;
{$mode objfpc}{$H+}
interface interface
uses uses
Classes, SysUtils, Classes, SysUtils,
pastree, pascal_parser_intf; pastree, pscanner, pascal_parser_intf;
type type
@ -464,7 +463,11 @@ begin
end; end;
end; end;
end; end;
{$IFDEF WST_TCLASS_MEMBERS}
locList := TPasClassType(AType).Members;
{$ELSE WST_TCLASS_MEMBERS}
locList := TPasClassType(AType).ClassVars; locList := TPasClassType(AType).ClassVars;
{$ENDIF WST_TCLASS_MEMBERS}
for i := 0 to locList.Count-1 do begin for i := 0 to locList.Count-1 do begin
locElement := TPasElement(locList[i]); locElement := TPasElement(locList[i]);
if locElement.InheritsFrom(TPasVariable) then begin if locElement.InheritsFrom(TPasVariable) then begin

View File

@ -10,16 +10,15 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
} }
{$INCLUDE wst_global.inc}
unit uprocedit; unit uprocedit;
{$mode objfpc}{$H+}
interface interface
uses uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls,
ExtCtrls, StdCtrls, ActnList, Menus, ExtCtrls, StdCtrls, ActnList, Menus,
pastree, pascal_parser_intf, pastree, PScanner, pascal_parser_intf,
edit_helper, Buttons; edit_helper, Buttons;
type type
@ -272,7 +271,11 @@ procedure TfProcEdit.SaveToObject();
try try
newObj := TPasFunction(FSymbolTable.CreateElement(TPasFunction,FObject.Name,prt,visPublic,'',0)); newObj := TPasFunction(FSymbolTable.CreateElement(TPasFunction,FObject.Name,prt,visPublic,'',0));
prt.Members.Add(newObj); prt.Members.Add(newObj);
{$IFDEF WST_TPASSOURCEPOS}
newObjType := FSymbolTable.CreateFunctionType('','result',newObj,False,Default(TPasSourcePos));
{$ELSE WST_TPASSOURCEPOS}
newObjType := FSymbolTable.CreateFunctionType('','result',newObj,False,'',0); newObjType := FSymbolTable.CreateFunctionType('','result',newObj,False,'',0);
{$ENDIF WST_TPASSOURCEPOS}
newObj.ProcType := newObjType; newObj.ProcType := newObjType;
CopyArgs(FObject.ProcType,newObjType); CopyArgs(FObject.ProcType,newObjType);
newObjType.ResultEl.ResultType := edtResultType.Items.Objects[edtResultType.ItemIndex] as TPasType; newObjType.ResultEl.ResultType := edtResultType.Items.Objects[edtResultType.ItemIndex] as TPasType;

View File

@ -58,6 +58,7 @@
{$IFEND} {$IFEND}
{$IF Defined(FPC_FULLVERSION) and (FPC_FULLVERSION >= 30101) } {$IF Defined(FPC_FULLVERSION) and (FPC_FULLVERSION >= 30101) }
{$DEFINE WST_TPASSOURCEPOS} {$DEFINE WST_TPASSOURCEPOS}
{$DEFINE WST_TCLASS_MEMBERS}
{$IFEND} {$IFEND}
{$ENDIF} {$ENDIF}