Skip to content

Commit

Permalink
Small changes to CC to support new Lape features.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPeel committed Jul 9, 2016
1 parent f5da850 commit bb577a4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
34 changes: 22 additions & 12 deletions Units/Misc/CastaliaSimplePasPar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2113,6 +2113,8 @@ procedure TmwSimplePasPar.FunctionProcedureName;
//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,
Expand Down Expand Up @@ -2153,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 @@ -2171,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 @@ -5038,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
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
9 changes: 5 additions & 4 deletions Units/Misc/v_ideCodeParser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,8 @@ function TciProcedureDeclaration.GetParamDeclarations: TDeclarationArray;
(fItems[i] is TciOutParameter) or
(fItems[i] is TciFormalParameter) or
(fItems[i] is TciInParameter) or
(fItems[i] is TciVarParameter) then
(fItems[i] is TciVarParameter) or
(fItems[i] is TciConstRefParameter) then
begin
SetLength(Result, Length(Result) + 1);
Result[High(Result)] := fItems[i];
Expand Down Expand Up @@ -1224,7 +1225,7 @@ procedure TCodeParser.TypeKind;

procedure TCodeParser.TypedConstant;
begin
if (not InDeclarations([TciVarDeclaration, TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter])) then
if (not InDeclarations([TciVarDeclaration, TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter, TciConstRefParameter])) then
begin
inherited;
Exit;
Expand Down Expand Up @@ -1473,7 +1474,7 @@ procedure TCodeParser.VarParameter;

procedure TCodeParser.ParameterName;
begin
if (not InDeclarations([TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter])) then
if (not InDeclarations([TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter, TciConstRefParameter])) then
begin
inherited;
Exit;
Expand All @@ -1486,7 +1487,7 @@ procedure TCodeParser.ParameterName;

procedure TCodeParser.NewFormalParameterType;
begin
if (not InDeclarations([TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter])) then
if (not InDeclarations([TciConstParameter, TciOutParameter, TciFormalParameter, TciInParameter, TciVarParameter, TciConstRefParameter])) then
begin
inherited;
Exit;
Expand Down

0 comments on commit bb577a4

Please sign in to comment.