mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 16:19:49 +01:00
Jedi code format: add support for record alignment directive.
This commit is contained in:
parent
afae7dfa87
commit
839c4e8307
@ -2186,6 +2186,11 @@ begin
|
||||
begin
|
||||
RecogniseRecordBody;
|
||||
Recognise(ttEnd);
|
||||
if fcTokenList.FirstSolidTokenType = ttAlign then
|
||||
begin
|
||||
Recognise(ttAlign);
|
||||
RecogniseConstantExpression;
|
||||
end;
|
||||
end;
|
||||
|
||||
RecogniseHintDirectives;
|
||||
|
||||
@ -155,6 +155,7 @@ type
|
||||
|
||||
{ reserved words that are directives }
|
||||
ttAbsolute,
|
||||
ttAlign,
|
||||
ttExternal,
|
||||
ttPascal,
|
||||
ttSafecall,
|
||||
@ -681,6 +682,7 @@ begin
|
||||
AddKeyword('package', wtReservedWordDirective, ttPackage);
|
||||
AddKeyword('contains', wtReservedWordDirective, ttContains);
|
||||
AddKeyword('requires', wtReservedWordDirective, ttRequires);
|
||||
AddKeyword('align', wtReservedWordDirective, ttAlign);
|
||||
|
||||
{ reseved words that are directives }
|
||||
AddKeyword('absolute', wtReservedWordDirective, ttAbsolute);
|
||||
|
||||
@ -91,6 +91,10 @@ begin
|
||||
if pt.HasParentNode(nAsm) then
|
||||
exit;
|
||||
|
||||
{ after record ... end align XX; }
|
||||
if (pt.TokenType = ttAlign) and pt.HasParentNode(nRecordType, 1) then
|
||||
exit(True);
|
||||
|
||||
lcSetReturns := FormattingSettings.Returns;
|
||||
Assert(lcSetReturns <> nil);
|
||||
|
||||
|
||||
@ -71,6 +71,10 @@ begin
|
||||
if pt.TokenType=ttReference then
|
||||
exit(true);
|
||||
|
||||
{ after record ... end align XX; }
|
||||
if (pt.TokenType = ttAlign) and pt.HasParentNode(nRecordType, 1) then
|
||||
exit(true);
|
||||
|
||||
// referencce to procedure/function
|
||||
if (pt.TokenType in [ttFunction,ttProcedure]) and (pt.PriorSolidTokenType=ttTo) then
|
||||
exit(true);
|
||||
|
||||
@ -316,7 +316,10 @@ begin
|
||||
if (lcNext <> nil) and (lcNext.TokenType = ttElse) then
|
||||
Result := (FormattingSettings.Returns.EndElseStyle = eAlways)
|
||||
else
|
||||
Result := True;
|
||||
begin
|
||||
{ after record ... end align XX; }
|
||||
Result := not ((lcNext <> nil) and (lcNext.TokenType = ttAlign) and lcNext.HasParentNode(nRecordType, 1));
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
||||
@ -78,6 +78,10 @@ begin
|
||||
|
||||
Result := False;
|
||||
|
||||
{ after record ... end align XX; }
|
||||
if (pt.TokenType = ttAlign) and pt.HasParentNode(nRecordType, 1) then
|
||||
exit(True);
|
||||
|
||||
if (pt.TokenType in operators) and pt.HasParentNode(nIdentifier,1) then //operator orverloading identifier;
|
||||
Exit(False);
|
||||
|
||||
|
||||
@ -78,6 +78,10 @@ begin
|
||||
if pt = nil then
|
||||
exit;
|
||||
|
||||
{ after record ... end align XX; }
|
||||
if (pt.TokenType = ttAlign) and pt.HasParentNode(nRecordType, 1) then
|
||||
exit(True);
|
||||
|
||||
if pt.HasParentNode(nGeneric, 1) then
|
||||
exit;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user