Skip to content

Commit

Permalink
Merge pull request #380 from MerlijnWajer/new_lape
Browse files Browse the repository at this point in the history
Updated Lape
  • Loading branch information
JohnPeel authored Jul 9, 2016
2 parents dbd48d9 + bb577a4 commit a7ce4f3
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Units/MMLAddon/LPInc/Classes/MML/lptclient.pas
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ procedure Register_TClient(Compiler: TLapeCompiler);
begin
addClass('TClient');

addGlobalType('procedure(s: string)', 'TWriteLnProc');
addNativeGlobalType('procedure(s: string)', 'TWriteLnProc');

addClassVar('TClient', 'IOManager', 'TIOManager', @TClient_IOManager_Read, @TClient_IOManager_Write);
addClassVar('TClient', 'MFiles', 'TMFiles', @TClient_MFiles_Read, @TClient_MFiles_Write);
Expand Down
10 changes: 10 additions & 0 deletions Units/MMLAddon/LPInc/Classes/lpclasshelper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ TLapeCompilerHelper = class helper for TLapeCompiler
public
procedure addClass(const Name: string; const Parent: string = 'TObject');
procedure addClassVar(const Obj, Item, Typ: string; const Read: Pointer; const Write: Pointer = nil; const Arr: boolean = False; const ArrType: string = 'UInt32');
function addNativeGlobalType(Str: lpString; AName: lpString): TLapeType;
end;

generic TRegisterWrapper<_T> = class(TComponent)
Expand Down Expand Up @@ -73,6 +74,15 @@ TOnMouseEventWrapper = class(specialize TRegisterWrapper<TMouseEventWrapper>)

implementation

function TLapeCompilerHelper.addNativeGlobalType(Str: lpString; AName: lpString): TLapeType;
begin
with addGlobalType(Str, '_' + AName) do
begin
addGlobalType('native _' + AName, AName);
Name := '!' + AName;
end;
end;

procedure TLapeCompilerHelper.addClass(const Name: string; const Parent: string = 'TObject');
begin
addGlobalType(Format('type %s', [Parent]), Name);
Expand Down
4 changes: 2 additions & 2 deletions Units/MMLAddon/LPInc/Classes/miniLCL/lplclcomctrls.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,8 @@ procedure RegisterLCLComCtrls(Compiler: TLapeCompiler);
addGlobalType('(tmBottomRight, tmTopLeft, tmBoth)', 'TTickMark');
addGlobalType('(tsNone, tsAuto, tsManual)', 'TTickStyle');
addGlobalType('(trLeft, trRight, trTop, trBottom)', 'TTrackBarScalePos');
addGlobalType('procedure(Sender: TObject; Index: integer)', 'TCheckListClicked');
addGlobalType('procedure(Sender: TObject; var AllowChange: Boolean)', 'TTabChangingEvent');
addNativeGlobalType('procedure(Sender: TObject; Index: integer)', 'TCheckListClicked');
addNativeGlobalType('procedure(Sender: TObject; var AllowChange: Boolean)', 'TTabChangingEvent');
addGlobalType('(tsTabs, tsButtons, tsFlatButtons)', 'TTabStyle');
addGlobalType('(tpTop, tpBottom, tpLeft, tpRight)', 'TTabPosition');
addGlobalType('(nboShowCloseButtons, nboMultiLine, nboHidePageListPopup, nboKeyboardTabSwitch, nboShowAddTabButton)', 'TCTabControlOption');
Expand Down
8 changes: 4 additions & 4 deletions Units/MMLAddon/LPInc/Classes/miniLCL/lplclcontrols.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1721,11 +1721,11 @@ procedure RegisterLCLControls(Compiler: TLapeCompiler);
begin
addGlobalType('(ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble, ssMeta, ssSuper, ssHyper, ssAltGr, ssCaps, ssNum, ssScroll, ssTriple, ssQuad, ssExtra1, ssExtra2)', 'TShiftStateEnum');
addGlobalType('set of TShiftStateEnum', 'TShiftState');
addGlobalType('procedure(Sender: TObject; var Key: Word; Shift: TShiftState)','TKeyEvent');
addGlobalType('procedure(Sender: TObject; var Key: char)','TKeyPressEvent');
addNativeGlobalType('procedure(Sender: TObject; var Key: Word; Shift: TShiftState)','TKeyEvent');
addNativeGlobalType('procedure(Sender: TObject; var Key: char)','TKeyPressEvent');
addGlobalType('(mbLeft, mbRight, mbMiddle, mbExtra1, mbExtra2)','TMouseButton');
addGlobalType('procedure(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer)','TMouseEvent');
addGlobalType('procedure(Sender: TObject; Shift: TShiftState; X, Y: Integer)', 'TMouseMoveEvent');
addNativeGlobalType('procedure(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer)','TMouseEvent');
addNativeGlobalType('procedure(Sender: TObject; Shift: TShiftState; X, Y: Integer)', 'TMouseMoveEvent');
addGlobalType('(sbHorizontal, sbVertical)','TScrollBarKind');
addGlobalType('(alNone, alTop, alBottom, alLeft, alRight, alClient, alCustom)', 'TAlign');
addGlobalType('(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)','TFormBorderStyle');
Expand Down
4 changes: 2 additions & 2 deletions Units/MMLAddon/LPInc/Classes/miniLCL/lplclforms.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1209,8 +1209,8 @@ procedure RegisterLCLForms(Compiler: TLapeCompiler);
with Compiler do
begin
AddGlobalType('(caNone, caHide, caFree, caMinimize)','TCloseAction');
AddGlobalType('procedure(Sender: TObject; var CloseAction: TCloseAction)','TCloseEvent');
AddGlobalType('procedure(Sender : TObject; var CanClose : boolean)','TCloseQueryEvent');
AddNativeGlobalType('procedure(Sender: TObject; var CloseAction: TCloseAction)','TCloseEvent');
AddNativeGlobalType('procedure(Sender : TObject; var CanClose : boolean)','TCloseQueryEvent');
AddGlobalType('(poDesigned, poDefault, poDefaultPosOnly, poDefaultSizeOnly, poScreenCenter, poMainFormCenter, poOwnerFormCenter)', 'TPosition');
AddGlobalType('(biSystemMenu, biMinimize, biMaximize, biHelp)', 'TBorderIcon');
AddGlobalType('set of TBorderIcon', 'TBorderIcons');
Expand Down
4 changes: 2 additions & 2 deletions Units/MMLAddon/LPInc/Classes/miniLCL/lplclstdctrls.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1986,10 +1986,10 @@ procedure RegisterLCLStdCtrls(Compiler: TLapeCompiler);
begin
addGlobalType('(ssNone, ssHorizontal, ssVertical, ssBoth,ssAutoHorizontal, ssAutoVertical, ssAutoBoth)','TScrollStyle');
addGlobalType('(scLineUp,scLineDown, scPageUp,scPageDown,scPosition, scTrack,scTop,scBottom,scEndScroll)','TScrollCode');
addGlobalType('procedure(Sender: TObject; ScrollCode: TScrollCode;var ScrollPos: Integer)','TScrollEvent');
addNativeGlobalType('procedure(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer)', 'TScrollEvent');
addGlobalType('(odSelected, odGrayed, odDisabled, odChecked, odFocused, odDefault, odHotLight, odInactive, odNoAccel, odNoFocusRect, odReserved1, odReserved2, odComboBoxEdit, odPainted)' , 'TOwnerDrawStateType');
addGlobalType('set of TOwnerDrawStateType', 'TOwnerDrawState');
addGlobalType('procedure(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState)', 'TDrawItemEvent');
addNativeGlobalType('procedure(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState)', 'TDrawItemEvent');
addGlobalType('(csDropDown,csSimple,csDropDownList,csOwnerDrawFixed,csOwnerDrawVariable)','TComboBoxStyle');
addGlobalType('(lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable, lbVirtual)', 'TListBoxStyle');
addGlobalType('(sbsNone, sbsSingle, sbsSunken)','TStaticBorderStyle');
Expand Down
2 changes: 1 addition & 1 deletion Units/MMLAddon/LPInc/Classes/miniLCL/lplclsystem.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ procedure RegisterLCLSystem(Compiler: TLapeCompiler);
begin
with Compiler do
begin
addGlobalType('Procedure(Sender:TObject)','TNotifyEvent');
addNativeGlobalType('procedure(Sender: TObject)', 'TNotifyEvent');
addGlobalType('^TNotifyEvent','PNotifyEvent');
addGlobalType('dword','THandle');
addGlobalType('string','TComponentName');
Expand Down
30 changes: 15 additions & 15 deletions Units/MMLAddon/LPInc/lpexportedmethods.inc
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ AddGlobalFunc('function pow(base,exponent: extended): extended', @Lape_pow);
AddGlobalFunc('function RiemannGauss(Xstart,StepSize,Sigma: extended; AmountSteps: integer): extended', @Lape_RiemannGauss);
AddGlobalFunc('function DiscreteGauss(Xstart,Xend: integer; sigma: extended): TExtendedArray', @Lape_DiscreteGauss);
AddGlobalFunc('function GaussMatrix(N: integer; sigma: extended): T2DExtendedArray', @Lape_GaussMatrix);
AddGlobalFunc('function Max(a, b: integer): integer', @Lape_Max);
AddGlobalFunc('function Min(a, b: Integer): Integer', @Lape_Min);
//AddGlobalFunc('function Max(a, b: integer): integer', @Lape_Max);
//AddGlobalFunc('function Min(a, b: Integer): Integer', @Lape_Min);
AddGlobalFunc('function MinE(a, b: extended): extended', @Lape_MinE);
AddGlobalFunc('function MaxE(a, b: extended): extended', @Lape_MaxE);
AddGlobalFunc('function Point(x, y: integer): TPoint', @Lape_Point);
AddGlobalFunc('function Distance(x1,y1,x2,y2: integer): integer', @Lape_Distance);
AddGlobalFunc('function Hypot(X, Y: Extended): Extended', @Lape_Hypot);
//AddGlobalFunc('function Hypot(X, Y: Extended): Extended', @Lape_Hypot);
AddGlobalFunc('function RandomRange(const aFrom, aTo: Integer): Integer', @Lape_RandomRange);
AddGlobalFunc('function RandomE: extended', @Lape_RandomE);
AddGlobalFunc('function ArcTan2(y,x: extended): extended', @Lape_ArcTan2);
//AddGlobalFunc('function ArcTan2(y,x: extended): extended', @Lape_ArcTan2);
AddGlobalFunc('procedure IncEx(var x: integer; increase: integer);', @Lape_IncEx);
AddGlobalFunc('procedure DecEx(var x: integer; Decrease: integer);', @Lape_DecEx);
AddGlobalFunc('function Factorial(number: longword): Int64', @Lape_Factorial);
Expand All @@ -186,25 +186,25 @@ AddGlobalFunc('function logn(base, x: extended): extended', @Lape_logn);
AddGlobalFunc('function sar(AValue: longint; shift: byte): longint', @Lape_sar);
AddGlobalFunc('function ror(num: longword; shift: byte): LongWord', @Lape_ror);
AddGlobalFunc('function rol(num: longword; shift: byte): LongWord', @Lape_rol);
AddGlobalFunc('function tan(e: extended): extended', @Lape_tan);
//AddGlobalFunc('function tan(e: extended): extended', @Lape_tan);
AddGlobalFunc('function radians(e: extended): extended', @Lape_radians);
AddGlobalFunc('function degrees(e: extended): extended', @Lape_degrees);
AddGlobalFunc('function ArcSin(e: extended): extended', @Lape_ArcSin);
AddGlobalFunc('function ArcCos(e: extended): extended', @Lape_ArcCos);
AddGlobalFunc('function Cotan(e: extended): extended', @Lape_Cotan);
AddGlobalFunc('function Secant(e: extended): extended', @Lape_Secant);
AddGlobalFunc('function Cosecant(e: extended): extended', @Lape_Cosecant);
//AddGlobalFunc('function ArcSin(e: extended): extended', @Lape_ArcSin);
//AddGlobalFunc('function ArcCos(e: extended): extended', @Lape_ArcCos);
//AddGlobalFunc('function Cotan(e: extended): extended', @Lape_Cotan);
//AddGlobalFunc('function Secant(e: extended): extended', @Lape_Secant);
//AddGlobalFunc('function Cosecant(e: extended): extended', @Lape_Cosecant);
AddGlobalFunc('function Cot(e: extended): extended', @Lape_Cot);
AddGlobalFunc('function Sec(e: extended): extended', @Lape_Sec);
AddGlobalFunc('function Csc(e: extended): extended', @Lape_Csc);
AddGlobalFunc('function Cosh(e: extended): extended', @Lape_Cosh);
AddGlobalFunc('function Sinh(e: extended): extended', @Lape_Sinh);
AddGlobalFunc('function Tanh(e: extended): extended', @Lape_Tanh);
//AddGlobalFunc('function Cosh(e: extended): extended', @Lape_Cosh);
//AddGlobalFunc('function Sinh(e: extended): extended', @Lape_Sinh);
//AddGlobalFunc('function Tanh(e: extended): extended', @Lape_Tanh);
AddGlobalFunc('function CotH(e: extended): extended', @Lape_CotH);
AddGlobalFunc('function SecH(e: extended): extended', @Lape_SecH);
AddGlobalFunc('function CscH(e: extended): extended', @Lape_CscH);
AddGlobalFunc('function ArcCosh(e: extended): extended', @Lape_ArcCosh);
AddGlobalFunc('function ArcSinh(e: extended): extended', @Lape_ArcSinh);
//AddGlobalFunc('function ArcCosh(e: extended): extended', @Lape_ArcCosh);
//AddGlobalFunc('function ArcSinh(e: extended): extended', @Lape_ArcSinh);
AddGlobalFunc('function DecRet(e: Extended): Extended', @Lape_DecRet);
AddGlobalFunc('function log10(f: Extended): Extended', @Lape_log10);
AddGlobalFunc('function MinA(a: TIntegerArray): Integer', @Lape_MinA);
Expand Down
9 changes: 5 additions & 4 deletions Units/MMLAddon/mmlpsthread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface
settings, settingssandbox, lcltype, dialogs, ExtCtrls
{$IFDEF USE_SQLITE}, msqlite3{$ENDIF}
{$IFDEF USE_LAPE}
, lpparser, lpcompiler, lptypes, lpvartypes,
, lpparser, lpcompiler, lptypes, lpvartypes, ffi, lpffi, lpffiwrappers,
lpeval, lpinterpreter, lputils, lpexceptions, LPDump
{$ENDIF};

Expand Down Expand Up @@ -312,7 +312,6 @@ implementation
SynRegExpr,
lclintf, // for GetTickCount and others.
Clipbrd,
lpffi, ffi, // For lape FFI

DCPcrypt2,
DCPrc2, DCPrc4, DCPrc5, DCPrc6,
Expand All @@ -321,7 +320,7 @@ implementation
DCPsha1, DCPsha256, DCPsha512,
DCPtiger

{$IFDEF USE_LAPE}, lpClasses{$ENDIF};
{$IFDEF USE_LAPE}, lpClasses, lpClassHelper{$ENDIF};

{$ifdef Linux}
{$define PS_SafeCall}
Expand Down Expand Up @@ -1394,6 +1393,7 @@ constructor TLPThread.Create(CreateSuspended: Boolean; TheSyncInfo: PSyncInfo; p
Compiler := TLPCompiler.Create(Parser);
Running := bFalse;

InitializeFFI(Compiler);
InitializePascalScriptBasics(Compiler);
ExposeGlobals(Compiler);

Expand All @@ -1414,7 +1414,8 @@ constructor TLPThread.Create(CreateSuspended: Boolean; TheSyncInfo: PSyncInfo; p
addGlobalFunc('procedure _writeln; override;', @lp_WriteLn);
addGlobalFunc('procedure DebugLn(s: string);', @lp_DebugLn);

addGlobalFunc('procedure Sync(proc: Pointer);', @lp_Sync);
addNativeGlobalType('procedure();', 'TSyncMethod');
addGlobalFunc('procedure Sync(Proc: TSyncMethod);', @lp_Sync);
addGlobalFunc('function GetCurrThreadID(): PtrUInt;', @lp_CurrThreadID);

for I := 0 to High(VirtualKeys) do
Expand Down
76 changes: 58 additions & 18 deletions Units/Misc/CastaliaSimplePasPar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1145,9 +1145,9 @@ procedure TmwSimplePasPar.UsedUnitName;

procedure TmwSimplePasPar.Block;
begin
while TokenID in [tokClass, tokConst, tokConstructor, tokDestructor, tokExports,
while (TokenID in [tokClass, tokConst, tokConstructor, tokDestructor, tokExports,
tokFunction, tokLabel, tokProcedure, tokResourceString, tokThreadVar, tokType,
tokVar{$IFDEF D8_NEWER}, tokSquareOpen{$ENDIF}] do
tokVar{$IFDEF D8_NEWER}, tokSquareOpen{$ENDIF}]) do
begin
DeclarationSection;
end;
Expand Down Expand Up @@ -1186,8 +1186,10 @@ procedure TmwSimplePasPar.DeclarationSection;
begin
ExportsClause;
end;
tokFunction:
tokFunction, tokIdentifier:
begin
if (TokenID = tokIdentifier) and (Lexer.ExId <> tokOperator) then
SynError(InvalidDeclarationSection);
ProcedureDeclarationSection;
end;
tokLabel:
Expand Down Expand Up @@ -2106,7 +2108,30 @@ procedure TmwSimplePasPar.ProcedureMethodDeclaration;

procedure TmwSimplePasPar.FunctionProcedureName;
begin
Expected(tokIdentifier);
if not (Lexer.TokenID in [tokIdentifier,

//Operators =)
tokMinus, tokOr, tokPlus, tokXor,
tokAnd, tokAs, tokDiv, tokMod, tokShl, tokShr, tokSlash, tokStar, tokStarStar,
tokEqual, tokGreater, tokGreaterEqual, tokLower, tokLowerEqual,
tokIn, tokIs, tokNotEqual,
tokDivAsgn,
tokMulAsgn,
tokPlusAsgn,
tokMinusAsgn,
tokPowAsgn]) then
begin
if TokenID = tokNull then
ExpectedFatal(tokIdentifier) {jdj 7/22/1999}
else
begin
if Assigned(FOnMessage) then
FOnMessage(Self, meError, Format(rsExpected, [TokenName(tokIdentifier), fLexer.Token]),
fLexer.PosXY.X, fLexer.PosXY.Y);
end;
end
else
NextToken;
end;

procedure TmwSimplePasPar.ObjectNameOfMethod;
Expand All @@ -2130,13 +2155,12 @@ procedure TmwSimplePasPar.FunctionProcedureBlock;
NoExternal: Boolean;
begin
NoExternal := True;
if TokenID = tokSemiColon
then SEMICOLON;
if TokenID = tokSemiColon then SEMICOLON;
case ExID of
tokForward:
ForwardDeclaration; // DR 2001-07-23
else
while ExID in [tokAbstract, tokCdecl, tokDynamic, tokExport, tokExternal, tokFar,
while (ExID in [tokAbstract, tokCdecl, tokDynamic, tokExport, tokExternal, tokFar,
tokMessage, tokNear, tokOverload, tokOverride, tokPascal, tokRegister,
tokReintroduce, tokSafeCall, tokStdCall, tokVirtual,
tokDeprecated, tokLibrary, tokPlatform, // DR 2001-10-20
Expand All @@ -2148,20 +2172,29 @@ procedure TmwSimplePasPar.FunctionProcedureBlock;
{$IFDEF D9_NEWER}
, tokInline
{$ENDIF}
] // DR 2001-11-14
, tokConst
]) or (TokenID = tokConstRef)// DR 2001-11-14
do
begin
case ExId of
tokExternal:
case TokenID of
tokConstRef:
begin
NextToken;
if (TokenID = tokSemiColon) then SEMICOLON;
end
else
case ExId of
tokExternal:
begin
ProceduralDirective;
if TokenID = tokSemiColon then SEMICOLON;
NoExternal := False;
end;
else
begin
ProceduralDirective;
if TokenID = tokSemiColon then SEMICOLON;
NoExternal := False;
end;
else
begin
ProceduralDirective;
if TokenID = tokSemiColon then SEMICOLON;
end;
end;
end;
Expand Down Expand Up @@ -4537,7 +4570,7 @@ procedure TmwSimplePasPar.ExplicitType;

procedure TmwSimplePasPar.TypeKind;
begin
if (TokenID = tokIdentifier) and (GenID = tokPrivate) then
if ((TokenID = tokIdentifier) and (GenID = tokPrivate)) or (ExID = tokNative) then
NextToken;

case TokenID of
Expand Down Expand Up @@ -4575,7 +4608,14 @@ procedure TmwSimplePasPar.TypeKind;
end;
tokPointerSymbol:
begin
PointerType;
Lexer.InitAhead;
if Lexer.AheadTokenID = tokConst then
begin
NextToken;
NextToken;
TypeKind;
end else
PointerType;
end;
tokString:
begin
Expand Down Expand Up @@ -5008,7 +5048,7 @@ procedure TmwSimplePasPar.ExportedHeading;
tokDeprecated, tokLibrary, tokPlatform, // DR 2001-10-20
tokLocal, tokVarargs // DR 2001-11-14
{$IFDEF D8_NEWER}, tokStatic{$ENDIF}{$IFDEF D9_NEWER}, tokInline{$ENDIF}
] do
, tokConst] do
begin
ProceduralDirective;
if TokenID = tokSemiColon then SEMICOLON;
Expand Down
2 changes: 1 addition & 1 deletion Units/Misc/ValistusDefines.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{.$DEFINE ccFORMCAPTION}

{$DEFINE ciCHECKDUPLICATES}
{$DEFINE D8_NEWER1}
{$DEFINE D8_NEWER}
{$DEFINE D9_NEWER}
{$DEFINE D10_NEWER}
{.$DEFINE D11_NEWER}
Expand Down
6 changes: 3 additions & 3 deletions Units/Misc/lpdump.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TLPCompiler = class(TLapeCompiler)
function addGlobalType(Typ: TLapeType; AName: lpString = ''; ACopy: Boolean = True): TLapeType; override;
function addGlobalType(Str: lpString; AName: lpString): TLapeType; override;
function addGlobalFunc(AHeader: lpString; Value: Pointer): TLapeGlobalVar; override;
function addDelayedCode(ACode: lpString; AfterCompilation: Boolean = True; IsGlobal: Boolean = True): TLapeTree_Base; override;
function addDelayedCode(ACode: lpString; AFileName: lpString = ''; AfterCompilation: Boolean = True; IsGlobal: Boolean = True): TLapeTree_Base; override;
procedure getInfo(aItems: TStrings);
end;

Expand Down Expand Up @@ -69,7 +69,7 @@ function TLPCompiler.addGlobalVar(Val: Int32; AName: lpString): TLapeGlobalVar;
begin
Result := inherited;
if (Length(AName) > 0) and (AName[1] <> '!') then
FItems.Add(AddLeadingSemiColon('var ' + AName + ': ' + IntToStr(Val)));
FItems.Add(AddLeadingSemiColon('var ' + AName + ': Int32 = ' + IntToStr(Val)));
end;

function TLPCompiler.addGlobalType(Typ: TLapeType; AName: lpString = ''; ACopy: Boolean = True): TLapeType;
Expand All @@ -92,7 +92,7 @@ function TLPCompiler.addGlobalFunc(AHeader: lpString; Value: Pointer): TLapeGlob
FItems.Add(AddLeadingSemiColon(AHeader) + ' forward;');
end;

function TLPCompiler.addDelayedCode(ACode: lpString; AfterCompilation: Boolean = True; IsGlobal: Boolean = True): TLapeTree_Base;
function TLPCompiler.addDelayedCode(ACode: lpString; AFileName: lpString = ''; AfterCompilation: Boolean = True; IsGlobal: Boolean = True): TLapeTree_Base;
begin
Result := inherited;
FItems.Add(ACode);
Expand Down
3 changes: 2 additions & 1 deletion Units/Misc/v_ideCodeInsight.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,8 @@ procedure TCodeInsight.Proposal_AddDeclaration(Item: TDeclaration; ItemList, Ins
(Item is TciOutParameter) or
(Item is TciFormalParameter) or
(Item is TciInParameter) or
(Item is TciVarParameter) then
(Item is TciVarParameter) or
(Item is TciConstRefParameter) then
begin
FirstColumn := FormatFirstColumn('param');
c[0] := TciParameterName;
Expand Down
Loading

0 comments on commit a7ce4f3

Please sign in to comment.