mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 01:11:07 +02:00
SynEdit: Pas-Highlighter, double-quotes, fix detecting quotes if they are the only char in a line. Issue from merge request !120
This commit is contained in:
parent
8235520f00
commit
e3a4b57951
@ -505,6 +505,7 @@ type
|
|||||||
procedure SlashContinueProc;
|
procedure SlashContinueProc;
|
||||||
procedure SpaceProc;
|
procedure SpaceProc;
|
||||||
procedure StringProc;
|
procedure StringProc;
|
||||||
|
procedure DoubleQuoteProc;
|
||||||
procedure StringProc_MultiLineDQ;
|
procedure StringProc_MultiLineDQ;
|
||||||
procedure SymbolProc;
|
procedure SymbolProc;
|
||||||
function TypeHelpersIsStored: Boolean;
|
function TypeHelpersIsStored: Boolean;
|
||||||
@ -2827,7 +2828,7 @@ begin
|
|||||||
'%': fProcTable[I] := @BinaryProc;
|
'%': fProcTable[I] := @BinaryProc;
|
||||||
'&': fProcTable[I] := @OctalProc;
|
'&': fProcTable[I] := @OctalProc;
|
||||||
#39: fProcTable[I] := @StringProc;
|
#39: fProcTable[I] := @StringProc;
|
||||||
'"': fProcTable[I] := @StringProc_MultiLineDQ;
|
'"': fProcTable[I] := @DoubleQuoteProc;
|
||||||
'0'..'9': fProcTable[I] := @NumberProc;
|
'0'..'9': fProcTable[I] := @NumberProc;
|
||||||
'A'..'Z', 'a'..'z', '_':
|
'A'..'Z', 'a'..'z', '_':
|
||||||
fProcTable[I] := @IdentProc;
|
fProcTable[I] := @IdentProc;
|
||||||
@ -3664,20 +3665,23 @@ begin
|
|||||||
FRange := FRange + [rsInProcHeader];
|
FRange := FRange + [rsInProcHeader];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSynPasSyn.DoubleQuoteProc;
|
||||||
|
begin
|
||||||
|
if (spmsmDoubleQuote in FStringMultilineMode) then begin
|
||||||
|
Inc(Run);
|
||||||
|
StringProc_MultiLineDQ();
|
||||||
|
end
|
||||||
|
else
|
||||||
|
SymbolProc();
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSynPasSyn.StringProc_MultiLineDQ;
|
procedure TSynPasSyn.StringProc_MultiLineDQ;
|
||||||
begin
|
begin
|
||||||
if (not (spmsmDoubleQuote in FStringMultilineMode)) then
|
|
||||||
begin
|
|
||||||
SymbolProc();
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
fTokenID := tkString;
|
fTokenID := tkString;
|
||||||
fRange := fRange + [rsAnsiMultiDQ];
|
fRange := fRange + [rsAnsiMultiDQ];
|
||||||
|
|
||||||
while (fLine[Run] <> #0) do
|
while (fLine[Run] <> #0) do
|
||||||
begin
|
begin
|
||||||
Inc(Run);
|
|
||||||
if (fLine[Run] = '"') then
|
if (fLine[Run] = '"') then
|
||||||
begin
|
begin
|
||||||
Inc(Run);
|
Inc(Run);
|
||||||
@ -3687,6 +3691,7 @@ begin
|
|||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Inc(Run);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user