sxsyn, misc style changes

This commit is contained in:
Basile Burg 2021-10-31 17:49:54 +01:00
parent 959e20d137
commit d4b700fbbc
1 changed files with 14 additions and 13 deletions

View File

@ -5,7 +5,7 @@ unit u_sxsyn;
interface
uses
Classes, SysUtils, Graphics,
Classes,
SynEditHighlighter, SynEditHighlighterFoldBase, SynEditTypes,
u_common;
@ -41,7 +41,6 @@ type
TSynSxSynRange = class (TSynCustomHighlighterRange)
private
attribParenCount : Integer;
rangeKind : TRangeKind;
public
procedure Assign(source: TSynCustomHighlighterRange); override;
@ -133,7 +132,7 @@ type
implementation
{$PUSH}{$R-}{$COPERATORS ON}
{$PUSH}{$R-}
class function KeywordMatch.hash(const w: string): Word;
var
i: integer;
@ -537,7 +536,7 @@ begin
begin
if not firstChar and (fLineBuf[fTokStop] = '_') then
fTokKind:=TTokenKind.tkError;
fTokStop += 1;
fTokStop += 1;
firstChar := true;
continue;
end
@ -565,7 +564,7 @@ begin
begin
if not firstChar and (fLineBuf[fTokStop] = '_') then
fTokKind:=TTokenKind.tkError;
fTokStop += 1;
fTokStop += 1;
firstChar := true;
continue;
end;
@ -595,7 +594,7 @@ begin
'\' : fTokStop += 2;
'"' :
begin
fTokStop += 1;
fTokStop += 1;
terminate := true;
break;
end
@ -621,7 +620,7 @@ begin
begin
if fLineBuf[fTokStop] = '`' then
begin
fTokStop += 1;
fTokStop += 1;
terminate := true;
break;
end
@ -714,12 +713,15 @@ begin
fTokKind := tkNone;
fTokStart := fTokStop;
llen := length(fLineBuf);
// EOL
if fTokStop > llen then
exit;
if fCurrRange.isNotAssigned then
fCurrRange := TSynSxSynRange.Create(nil);
// special lines
if (fLineBuf.length > 1) then
begin
// she bang
@ -736,10 +738,11 @@ begin
end;
end;
// continue partial multi-line ranges
case fCurrRange.rangeKind of
TRangeKind.rkString1: begin lexStringLiteral(); exit; end;
TRangeKind.rkString2: begin lexRawStringLiteral(); exit; end;
TRangeKind.rkBlockCom1: begin lexStarComment(); exit; end;
TRangeKind.rkString1: begin lexStringLiteral(); exit; end;
TRangeKind.rkString2: begin lexRawStringLiteral(); exit; end;
TRangeKind.rkBlockCom1: begin lexStarComment(); exit; end;
end;
case fLineBuf[fTokStop] of
@ -747,7 +750,6 @@ begin
begin
fTokStop += 1;
fTokKind := TTokenKind.tkBlank;
exit;
end;
// `//comment` `/*comment` `/=` `/`
'/':
@ -806,7 +808,7 @@ begin
end;
'@':
begin
fTokKind := TTokenKind.tkError;
fTokKind := TTokenKind.tkError;
fTokStop += 1;
if fTokStop <= llen then
begin
@ -829,7 +831,6 @@ begin
else begin
fTokStop += 1;
fTokKind := TTokenKind.tkError;
exit;
end;
end;
end;